Hello,
I wonder if mandrill support ability to send mail with attached ics file.
Lets say I have some template.
function sendMailMandrillInvite($name, $contact_email, $textarea, $url, $template_name = 'invite-businesses'){
$merge = 'true';
$message = array('dest_mail' => $contact_email, 'merge' => $merge);
$message['to'] = array(array('email' => $contact_email));
$mergeVars[] = array(
'rcpt' => $contact_email,
'vars' => array(
array('name' => 'contact_name', 'content' => $name),
array('name' => 'message', 'content' => $textarea),
array('name' => 'url', 'content' => $url)
)
);
$template_content = array(array('name' => 'example name', 'content' => 'example content')); // dummy usage
$message['merge_vars'] = $mergeVars;
return $this->messages_send_template($template_name, $template_content, $message);
}
What is the way to create template (HTML) and attach ics file to make mandrill mail to be "invitation"?
Is it possible?
Thanks,
So this is a way I used:
Template
Where
content
is:content
base64_encode():You should use https://icalendar.readthedocs.io/en/latest/index.html to generate simple ics file, convert it to base64 with https://docs.python.org/2/library/base64.html#base64.b64decode and send as attachment