gpt4 book ai didi

codeigniter - 顶杆 : How to attach ics invitation file to template?

转载 作者:行者123 更新时间:2023-12-04 14:58:06 24 4
gpt4 key购买 nike

你好,

我想知道 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);
}

创建模板(HTML)并附加ics文件使mandrill邮件成为“邀请”的方法是什么?

是否可以?

谢谢,

最佳答案

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
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Fessy M;X-NUM-GUESTS=0:MAILTO:snaggs2@gmail.com
DESCRIPTION:dddd mandrill
LOCATION:dddddd mandrill
SUMMARY:Can I lay low? Cook some yay-yo 2
TRANSP:OPAQUE
SEQUENCE:0
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR"
content base64_encode() :
QkVHSU46VkNBTEVOREFSDQpWRVJTSU9OOjIuMA0KUFJPRElEOi0vL01lZXRlci9tZWV0ZXIvL05PTlNHTUwgdjEuMC8vRU4NCkNBTFNDQUxFOkdSRUdPUklBTg0KTUVUSE9EOlJFUVVFU1QNCkJFR0lOOlZFVkVOVA0KRFRTVEFSVDoyMDE0MTAxOFQyMDMwMDBaDQpEVEVORDoyMDE0MTAxOFQyMTAwMDBaDQpVSUQ6MjAxNDEwMTVUMDAyODEzLTIyMzc4ODg2OEBtZWV0ZXIuY29tDQpEVFNUQU1QOjIwMTQxMDE0VDIxMjgxM1oNCk9SR0FOSVpFUjtDTj0ic25hZ2dzQGdtYWlsLmNvbSI7U0VOVC1CWT0iTUFJTFRPOnNvbWVhcHBAZ21haWwuY29tIjtMQU5HVUFHRT1zZTpNQUlMVE86c25hZ2dzQGdtYWlsLmNvbQ0KQVRURU5ERUU7Q1VUWVBFPUlORElWSURVQUw7Uk9MRT1SRVEtUEFSVElDSVBBTlQ7UEFSVFNUQVQ9TkVFRFMtQUNUSU9OO1JTVlA9VFJVRTtDTj1GZXNzeSBNO1gtTlVNLUdVRVNUUz0wOk1BSUxUTzpzbmFnZ3MyQGdtYWlsLmNvbQ0KREVTQ1JJUFRJT046ZGRkZCBtYW5kcmlsbA0KTE9DQVRJT046ZGRkZGRkIG1hbmRyaWxsDQpTVU1NQVJZOkNhbiBJIGxheSBsb3c/IENvb2sgc29tZSB5YXkteW8gMg0KVFJBTlNQOk9QQVFVRQ0KU0VRVUVOQ0U6MA0KU1RBVFVTOkNPTkZJUk1FRA0KRU5EOlZFVkVOVA0KRU5EOlZDQUxFTkRBUg==

enter image description here

关于codeigniter - 顶杆 : How to attach ics invitation file to template?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26178760/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com