We need to send an Email with Attachment from Salesforce to MailGun (An Email Marketing API) using the Salesforce Platform.
MailGun Website: [url removed, login to view]
MailGun Documentation: [url removed, login to view]
We need the ability to call in to one method to do this, and we need to send our Emails using the following method signature:
public String sendEmail(String pAPIKey, String pEndpointAddress, List pToAddress, String pFromAddress, String pEmailSubject, List pCCAddress, List pBCCAddress, String pHTMLContent, String pTextContent, Map pAttachmentData);
Here is a breakdown of what all the parameters are, most of them are pretty self-explanatory but I will mention them anyway:
String pAPIKey - The API key that we specify to authenticate ourselves with the Server.
String pEndpointAddress - The Endpoint which we will send our POST message to, will always be a Mailgun Endpoint but does change depending upon the Account Name.
List pToAddress - To Addresses of the Email (Who we are sending to)
String pFromAddress - From Address of the Email (Who the email is from)
String pEmailSubject - The Subject of the Email (The Subject which will be displayed when the Email is sent)
List pCCAddress - The Carbon-Copy Addresses of the Email (An additional copy of the email will be sent to these addresses)
List pBCCAddress Address - The Blind-Carbon-Copy Addresses of the Email (An additional hidden copy of the email will be sent to these addresses)
String pHTMLContent - This will be the content of the Email that we want to send, this is so we can send Rich Content Emails.
String pTextContent - This is the text-version of the Email that we want the ability to send.
Finally we have our Attachment Parameter:
Map pAttachmentData - This is where our attachments will be specified, the Key of the Map being the Filename, and the Value being the data.
End result we should be able to send Rich HTML Emails with Attachments through MailGun Specifying who the email is to, who it is from, who is Carbon-Copied in, the subject, the content, and the attachment data.
You will supply full source for the developed Apex Class.
5 freelancers are bidding on average £490 for this job
Hi, I have vast experience in [url removed, login to view] and I can do this in 15 days.I have done a similar kind of project with [url removed, login to view] where attachments were stored in Box.com. Let me know if you are interested in my proposal More
Hi We are interested in your project and read your [url removed, login to view] have completed 150+ big projects in last 5 years. Please check private message board for details.