How to user Mandrill Handlebars in Java? - email

We are using Mandrill to send emails. Till now we used only the templates but now we need to use handlebars. We use this Java client But I was not able to make the handlebars functionality work.
I am sending a message using:
MandrillMessageStatus[] statuses = mandrillApi.messages().sendTemplate(key, templateContent, message, false);
Where I should add the map of values to be used by the handle bars?
Thanks

The main problem is that you need to enable Handle bars on Mandrill and they mention it all the way on the bottom of the docs. So if you are the type of people that skim and then get their hands dirty... then just to the bottom part of this to learn how to enable it

Related

Prevent SendGrid from replacing <a> tags in Dynamic Templates

I'm using the #sendgrid/mail library to send emails from our app, using a dynamic template. The template is created entirely with custom HTML.
When emails are delivered, any custom code in <a> tags is ignored.
More specifically, SendGrid adds a "data-saferedirecturl" attribute and strips out any other attributes I add.
I've already tried disabling SendGrid click tracking globally, as well as disabling it individually, but neither seems to make any difference.
Anyone know if it's possible to change this behavior, either via the SendGrid dashboard or API settings?
There is a trackingSettings parameter to the send() API call, so you can add something like:
trackingSettings: {
clickTracking: {enable: false}
},

Thunderbird78+: How to check for message create, reply and forward

I am a beginner in thunderbird addons so I really appreciate if you can help me. I am trying to find a way in my background javascript to check whenever a user has opened the window for create a new message, reply a message and forward a message. I want to put a default text in the message window before the user is gonna send it. I know thunderbird 78+ should only uses web extension APIs and i found this Compose API but how to use it in my background script.
https://thunderbird-webextensions.readthedocs.io/en/78/compose.html
It looks like setComposeDetails() is what you want.
setComposeDetails(tabId, details)
Updates the compose window. Specify only fields that you want to change. Currently only the to/cc/bcc/replyTo/followupTo/newsgroups fields and the subject are implemented.
tabId (integer)
details (ComposeDetails)
I have note tried it, but I suppose that either details.body or details.plainTextBody from the ComposeDetails object can be used to pass the default text you want to use. So I would try something like this in the background script:
let details = {
body: "This is my default text",
};
browser.messages.setComposeDetails(tabId, details);
You might have to combine it with a call to messages.getComposeDetails() if empty fields in details reset the values in the composer window (I don't know).
If you want to call this when the user opens a new compose window, I would look at the window.onCreated event. If you want to do it right before the message is sent instead, you should look at the compose.onBeforeSend event. All of them are described in the API documentation.

Expression Engine using the Champagne Extension troubleshooting

I have an issue in Expression Engine using the Champagne Extension where it won't allow me to send out campaigns. This extension utilizes https://www.campaignmonitor.com/ api to send out mass emails.
The Error I get is "HTML Content URL Required" when I try to send out campaigns form the back end of the Expression Engine Install.
What could be causing this issue that relates to the expression engine install?
This error is received anytime the URL to your html or text content is not visible. More often this is seen when someone forget to include the text version. A good way to test is to click the preview HTML/TEXT button and make sure both give you the correct results.
They cannot be blank.
For an alternative solution, be sure to checkout my add-on Postmaster. It allows clients to publish email campaigns just by creating a new entry. You can setup any number of configuration, so you can even send draft email to a test subscriber list. And since everything is within channel entries, you can use whatever fieldtypes you like, and it works with MailChimp as well as CampaignMonitor.
https://objectivehtml.com/articles/postmaster-the-definitive-email-solution-for-expressionengine

How to put a chart in an smtp email

I am looking to include a pie chart in a html smtp email.
I thought about an ASP.NET chart first, but this is on the front end. Then I thought about High Charts but I can't attach the javascript for them. Finally I decided on Google Chart API.
I searched around and found if I put the URL into an image tag it will put the image returned from the URL into my email. But I've done this and am only getting the "alt" text. A bit of googling said I need to make my smtp HTML. But I've done that too and still no image.
var mail = new MailMessage();
mail.From = new MailAddress("email#address.com");
mail.To.Add("email#address.com");
mail.Subject = "Chart Test";
mail.Body = "<img src='https://chart.googleapis.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Hello|World' alt='chart' />";
mail.IsBodyHtml = true;
var smtp = new SmtpClient();
smtp.Send(mail);
Any suggestions would be greatly appreciated.
Ps - This is my first post so be gentle lol
I'd go back a few steps in determining what's wrong with this thing here. First of all, send an e-mail with an image in it full stop. Next, I notice that the source of the image is https. Verify whether that's possible with a simpler HTTPS image. Then, it'd be worthwhile checking if you can even include content from a webserver that isn't your own via e-mail (could have something to do with server settings).
Those 3 steps of debugging will lead to your answer, I hope!
Good luck!
some things I see wrong with your approach are:
1: your mail body is an incomplete html document
2: you are linking external content instead of including the image in the email,
external images are often blocked by spam filters etc.
3: you are sending what might be confidential data to google
4: your chosen pie chart is not circular is this a deliberate attempt to mislead?
Is the proportion relative to the inked area,
visible subtebded angle, pre-tranformation subtebded angle,
and if so it the transformation oblique or perspective?
urnortunately I don't know enough about asp mail to give details of how to fix that
but for best results you should:
1> send valid HTML
2> generate the graph on your server and send it and the html together in the email as multipart-related
3> combine that and a text a version (using multipart alternative)
4> be sure to generate a circular pie chart, If you want it to look good (especially when printed out) use a vector format like SVG instead of a pixel format.

Force.com email service

I have created an email service in force.com.Can anyone help me out of how to use thta in apex classes.say,i wanna send mail when user registration is successful??
Many Thanks,
Sandhya Krishnan
I assume you want to send an email directly from Apex code, either in a Trigger or from a page controller ... ? If so, this page can get you started:
http://www.forcetree.com/2009/07/sending-email-from-your-apex-class.html
Clearly you don't want to hard-code your email template into your classes, so make sure to read at least through the part that shows how to look up the template dynamically. That should be enough to get you on your way.