Skip to content

A simple coldfusion example of the Mailgun API with Coldfusion and cfhttp

License

Notifications You must be signed in to change notification settings

convurt/Coldfusion-Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mailgun SendMail with Coldfusion

A simple Coldfusion script to send mail with the Mailgun API

Authors

Usage/Examples

Set the DOMAIN.COM to your sending DOMAIN in the below line

url="https://api.mailgun.net/v3/DOMAIN.COM/messages",

Set the password="MAILGUN API KEY" to your MAILGUN API

Custom paramaters and templates

In the lines below I am using a template I built in MAILGUN.  If you are not using a template, you could remove these.
If you are passing in HTML, the templates use 3 handlebars for HTML. {{{content}}}

param template = "template-name";

param t_variables = serializeJSON({
    "content":"#email_content#",
    "company_contact":"#contact_name#",
    "email_button_text":"#email_button_text#",
    "email_button_link":"#email_button_link#"
});

cfhttpparam(name="t:variables", type="formfield", value="#t_variables#");

Installation

Add the file to your website project and include the file where needed. Pass in dynamic parameters as needed.

<cfinclude template="/mailgun.cfm"> 

License

MIT

About

A simple coldfusion example of the Mailgun API with Coldfusion and cfhttp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published