Async Mail
Last updated
Was this helpful?
Was this helpful?
newMail(
to : "email@email.com",
from : "no_reply@mydomain.com",
subject : "Mail Services Rock",
type : "html",
bodyTokens : {
user : "Luis",
product : "ColdBox",
link : event.buildLink( 'home' )
}
)
.setBody("
<p>Dear @user@,</p>
<p>Thank you for downloading @product@, have a great day!</p>
<p><a href='@link@'>@link@</a></p>
")
.sendAsync()
.then( function( mail ){
// Async pipeline that can process the mail once it is sent.
})var mailId = newMail(
to : "email@email.com",
from : "no_reply@mydomain.com",
subject : "Mail Services Rock",
type : "html",
bodyTokens : {
user : "Luis",
product : "ColdBox",
link : event.buildLink( 'home' )
}
)
.setBody("
<p>Dear @user@,</p>
<p>Thank you for downloading @product@, have a great day!</p>
<p><a href='@link@'>@link@</a></p>
")
.queue();moduleSettings = {
cbmailservices : {
runQueueTask: false
}
}