Does anything look wrong with this? It works fine in development but in production I get the email and it has no body? Really lost here
handler
public void function sendNotification(contact){
var template = ‘contact/sendNotification’;
// create a new mail object
local.email = MailService.newMail().config(
from="dan@danvega.org",
to="danvega@gmail.com",
subject=“danvega.org contact form submission”
);
/**
- Set tokens within the mail object. The tokens will be evaluated
- by the ColdBox Mail Service. Any matching @key@ within the view
- will be replaced with the token’s value
*/
local.email.setBodyTokens({
name = arguments.contact.getName(),
email = arguments.contact.getEmail(),
comments = arguments.contact.getComments()
});
// Add HTML email
local.email.addMailPart(charset=‘utf-8’,type=‘text/html’,body=renderer.renderView(view=template));
// Send the email. MailResult is a boolean.
local.mailResult = mailService.send(local.Email);
}
/views/contact/sendNotification.cfm
danvega.me contact form submissionName: @NAME@
Email: @EMAIL@
Comments: @COMMENTS@