- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
你好,
我想知道 mandrill 是否支持发送带有附件的邮件的能力 ICS 文件。
假设我有一些模板。
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);
}
最佳答案
Currently, we aren't able to support the text/calendar multipart format—which is typically the format being used to add those event invitations in emails. When Mandrill's parser hits these kinds of message parts (text/calendar), it will skip over them since they don't conform to anything that it knows how to abstract away. It's not true text or HTML, attachment or embedded image. In the future, we'll look into adding special support for this particular form of message as it's quite popular, but I can't provide any specific ETA on when that might be. In the meantime, you might consider generating the .ics files and attaching them, just as you might with other types of attachments through the Mandrill API or SMTP integration.
The Mandrill Crew
{
"key": "xxxxxxxxxxxxxxxxxx",
"template_name": "fess1",
"template_content": [
{
"name": "example name",
"content": "example content"
}
],
"message": {
"merge": "true",
"to": [
{
"email": "snaggs@gmail.com",
"name": "Snaggs",
"type": "to"
}
],
"headers": {
"Reply-To": "snaggs@gmail.com",
"MIME-Version": 1.0
},
"merge": true,
"merge_vars": [
{
"rcpt": "snaggs@gmail.com",
"vars": [
{
"name": "FNAME",
"content": "Snaggis"
}
]
}
],
"attachments": [
{
"type": "text/calendar",
"name": "meeting.ics",
"content": "QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOjIuMA0KUFJPRElEOi0vL01lZXRlci9tZWV0ZXIvL05PTlNHTUwgdjEuMC8vRU4NCkNBTFNDQUxFOkdSRUdPUklBTg0KTUVUSE9EOlJFUVVFU1QNCkJFR0lOOlZFVkVOVA0KRFRTVEFSVDoyMDE0MTAxOFQyMDMwMDBaDQpEVEVORDoyMDE0MTAxOFQyMTAwMDBaDQpVSUQ6MjAxNDEwMTVUMDAyODEzLTIyMzc4ODg2OEBtZWV0ZXIuY29tDQpEVFNUQU1QOjIwMTQxMDE0VDIxMjgxM1oNCk9SR0FOSVpFUjtDTj0ic25hZ2dzQGdtYWlsLmNvbSI7U0VOVC1CWT0iTUFJTFRPOnNvbWVhcHBAZ21haWwuY29tIjtMQU5HVUFHRT1zZTpNQUlMVE86c25hZ2dzQGdtYWlsLmNvbQ0KQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEtUEFSVElDSVBBTlQ7UEFSVFNUQVQ9TkVFRFMtQUNUSU9OO1JTVlA9VFJVRTtDTj1GZXNzeSBNO1gtTlVNLUdVRVNUUz0wOk1BSUxUTzpzbmFnZ3MyQGdtYWlsLmNvbQ0KREVTQ1JJUFRJT046ZGRkZCBtYW5kcmlsbA0KTE9DQVRJT046ZGRkZGRkIG1hbmRyaWxsDQpTVU1NQVJZOkNhbiBJIGxheSBsb3c/IENvb2sgc29tZSB5YXkteW8gMg0KVFJBTlNQOk9QQVFVRQ0KU0VRVUVOQ0U6MA0KU1RBVFVTOkNPTkZJUk1FRA0KRU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg=="
}
]
}
}
content
是:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Meeter/meeter//NONSGML v1.0//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20141018T203000Z
DTEND:20141018T210000Z
UID:20141015T002813-223788868@meeter.com
DTSTAMP:20141014T212813Z
ORGANIZER;CN="snaggs@gmail.com";SENT-BY="MAILTO:someapp@gmail.com";LANGUAGE=se:MAILTO:snaggs@gmail.com
ATT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BVFVTOkNPTkZJUk1FRA0KRU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg==
关于codeigniter - 顶杆 : How to attach ics invitation file to template?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26178760/
你好, 我想知道 mandrill 是否支持发送带有附件的邮件的能力 ICS 文件。 假设我有一些模板。 function sendMailMandrillInvite($name, $contact
我是一名优秀的程序员,十分优秀!