Django Send Email inputting whitespace character into link? - django

Im building an html email from scratch and then sending it through the email.send() function of EMailMEssage. My Html takes in links from an assets path in on the site and sends it through the email for users to download. Now for some reason when i display the email in an email client my url looks as follows. "myWebSite/media/th%20umbnails/2013/09/10/v4_t.png" as you can see the client is rendering the link with a whitespace between th and um of the word thumbnails and I cant figure out as to why. ANy other questions please ask. Im really stumped by this...

Related

Problem with email sending when server status is on smtp

So I am making a website with account activation when registering and this works fine. But the part where I have to send email to reset password doesn't. If I turn the email backend to 'console', It works fine. In the console I get the message with the token link to reset the password. When I turn the email backend to 'smtp' it just doesnt work and I get a long error after I submit the email that the message has to be sent on. Also I don't have a pasword reset view. I don't know if that is the problem.email_SettingsPassword reset formspasswordreset_confirm_htmlpassword_reset_Form_htmlpassword_reset_urlserrorerror location
I tried moddeling a Password reset view. I don't know if the view was right or this does not solve the problem. Also I googled this error but I didnt find something useful. Tried to change some urls.

Is there a way to embed a PDF into a CFMAIL?

I want to embed a PDF into an an email I am generating with CFMAIL. I am trying this but the email just shows nothing:
<cfhttp
url="https://jaydien.ezservicetrax.com/lifeback/docs/form1.pdf"
getasbinary="auto"
method="get"
result="urlContent"
>
</cfhttp>
Can anyone assist?
This is a limitation of EMAIL, not of ColdFusion (<cfmail>).
An email is either plain text or HTML
You might have seen this video showing how to embed a PDF into an email in Outlook:
https://www.youtube.com/watch?v=-0mdeBnmFlI
This option only exists in the Outlook desktop client, not the web UI, because all it's doing in displaying the first page of the PDF as an image in the body of the email. This conversion is done by the client and not possible via a browser.
Another reference to this question from this Adobe forum post from 2014 has more of an explanation. There's even a response from 2020 where someone is asking if there's any update on this and the answer is still
Send it as an attachment.

Pandorabots - send an email

Good Day.
Is it possible for a chatbot to send an email (or run a script or pageurl that sends an email) invisibly (preferably) to the visitor when reaching some goal?
For example, the visitor asks a callback and after the chatbot receive his phone - this phone must be send to the person who will call the visitor.
Is it possible?
Yes I want to use PHP for this. But how can I send command to PHP file without clicking button and open this file?
Tried this:
<category>
<pattern>TESTSENDPHONE *</pattern>
<template>
SEND PHONE
<oob><url>http://website/send_email.php?message=<star /></url></oob>
</template>
</category>
not work.
Can a chatbot to send data to the Internet (any way - any language)? For example, using Javascript (AJAX), which is already used in chatbot, or any other language (method)?
I wrote a tutorial on something similar here which may help:
https://discover.bot/bot-talk/aiml-tutorial-survey-questions/
To send an email invisibly, you'll need to look at the mail function of PHP. This article should help:
https://tecadmin.net/send-email-using-php-script/
Alternatively, someone should be checking the bot conversation logs to manually pick out such details and contact your customers. You'll see the phone numbers etc in the logs.

Django: SendGrid Click Tracking service prevents messages framework from working

I'm trying to implement signup with confirmation email with Django using SendGrid as email provider, my 'SignUpActivationView' code validates the token and then redirects the user to the home page, where a success/error message is displayed using the messages framework:
class SignUpActivationView(RedirectView):
redirect_url = reverse_lazy('link_list')
def dispatch(self, request, *args, **kwargs):
...
# if token is valid:
messages.error(self.request, 'Your account is now active.')
return HttpResponseRedirect(self.redirect_url)
# if token is invalid:
messages.error(self.request, 'Your account could not be activated.')
return HttpResponseRedirect(self.redirect_url)
So far my approach works as long as I copy-paste the link in my browser, if I click on it instead, the user is activated but the success message is not shown in my application. I believe this is because SendGrid's Click Tracking service is wrapping my link:
A workaround I found is to tell SendGrid to NOT track the link by adding and the 'clicktracking=off' HTML attribute, the disadvantage is that I can only tell SendGrid not to track links in the HTML version of my email. In case the user's email client decides to open the Plain text version of the email, then link will still be wrapped.
# solution: do not track clicks
# caveat: only works in HTML, not in plain text emails
<a clicktracking=off href="http://foo.bar">Confirmation link</a>
So Link Tracking is pretty month mandatory for Plain text emails.
Is there any way to make the messages framework work with Link Tracking?
When SendGrid tracks your link, the "click" goes to SendGrid, which returns a 302 Found redirect to the URL you provided in the original email, before SendGrid tracked it.
So, as long as you provide the correct link there, by the time the "click" is getting to your server, it's back to that, with the appropriate token.
You can review this behavior in Chrome's Developer Tools, under the Network tab, which should help you troubleshoot what's happening here.
Also, you can disable all of SendGrid's Click Tracking, instead of just link-by-link, under their Settings: Tracking Settings section.
By default, SendGrid does not track plain-text links, since it makes them so much longer. You'd have to actively enable that under those same settings if you want it to do that. It's very rare that a recipient views in Plain Text these days, so it's not a significant contributor to your engagement statistics, so enabling that feature is generally not recommended.

Receiving emails with sendgrid and cloudmailin

I have the same concept as mentioned in this question(generating a unique random email address for each user in rails app. When the user sends an email that that randomly generated email address, we process the body and store in db.
I followed the following steps:
Deployed my app in Heroku
Created a sendgrid account and configured the username and password to heroku(to get the sendgrid addon).
added griddler gem and followed the steps mentioned in griddler.
Configured the parse webhook in sendgrid with my host and url.
Here comes the main problem:
I registered to coludmailin and it generated the single email address. I don't really understand how to receive uniq emails to my rails application now. I tried white labeling the cloudmailin.net in sendgrid but it doesn't work(may be am wrong here).
Googled a lot but didn't understand how to proceed from here. Can someone please help me in solving this issue. Appreciate if I get a good step-by-step reference
There are two options to do this with CloudMailin.
Option 1:
On the free plan you can use a + in order to separate the email address given to you on CloudMailin and still create a unique email address that each customer can respond to. For example:
If you CloudMailin email address is example1234#cloudmailin.net you can use example1234+unique_id_54321#cloudmailin.net. CloudMailin calls unique_id_54321 the disposable part of this email address. This way you can send an email out and state the sender of that email is example1234+unique_id_54321#cloudmailin.net and then tell one user from another.
Option 2 (the better option):
However, the best way to do this is to use CloudMailin's custom domains. You can then receive anything#yourdomain.com.
With custom domains enabled you set CloudMailin up to be your MX server. Then any email coming into yourdomain.com goes direct to CloudMailin (you can use app.yourdomain.com to avoid conflicts with your regular email if needed).
You can then send email out with the sender as user-12345#yourdomain.com, task-12345#yourdomain.com or any other unique identifier. When you receive the email from CloudMailin the envelope will show that the email was sent to user-12345#yourdomain.com and you can then use this to resolve who the user was.