自定义邮件模板
这篇文章是给谁看的?
老师,不。
Incydr Professional, Enterprise, Horizon和Gov F2,是的。
Incydr基础,高级和Gov F1,是的。
概述
Code42环境为许多类型的事件发送电子邮件通知,例如用户备份状态警报、管理员备份状态报告和密码恢复请求。这些电子邮件通知是基于标准化模板(。eml文件)存储在Code42云的实例中。
本文描述了如何使用以下Code42 API资源自定义电子邮件模板的内容:
email-text-customization
自定义邮件文本内容。EmailLogoCustomization
自定义在电子邮件中出现在Code42标志旁边的联合品牌标志。
注意事项
- 要完成此过程,必须具有客户云管理的角色。
- 这个过程需要使用Code42 API.
- 如果您不熟悉使用api,请复习Code42 API语法和用法.
- 有关使用Code42 API的帮助,请联系您的客户成功经理(CSM)与Code42专业服务团队联系。
- 组织中的用户客户端可见性设置为隐藏的不要接收电子邮件通知。
使用本文中的过程对电子邮件模板所做的更改在生产电子邮件系统中是实时的。在正式发布之前,没有测试区域来验证您的更改。
API结构和语法
请求URL
美国
- 如果您在https://console.us.code42.com (US1)登录到Code42控制台,请使用:
- https://authority-east-lb.us.code42.com/api/v4/email-text-customization/
- https://authority-east-lb.us.code42.com/api/v3/EmailLogoCustomization/
- 如果您登录到Code42控制台https://console.us2.code42.com(2)使用方法:
- https://console.us2.code42.com/api/v4/email-text-customization/
- https://console.us2.code42.com/api/v3/EmailLogoCustomization/
- 如果您在https://console.gov.code42.comm (US3)登录到Code42联邦环境的Code42控制台,请使用:
- https://default-primary.gov.code42.com/api/v4/email-text-customization/
- https://default-primary.gov.code42.com/api/v3/EmailLogoCustomization/
爱尔兰
- 如果您在https://console.ie.code42.com (EU1)登录到Code42控制台,请使用:
- https://default-primary.ie.code42.com/api/v4/email-text-customization/
- https://default-primary.ie.code42.com/api/v3/EmailLogoCustomization/
可以自定义的电子邮件
属性可自定义以下电子邮件中的文本email-text-customization
API的资源。这些示例电子邮件显示了默认的电子邮件文本。
您可以自定义这些电子邮件的以下部分:
- 每封电子邮件的发件人电子邮件地址
- 备份提醒邮件的标题(标题)和正文
- 备份报告邮件正文
- 密码重置邮件的主体
- 出现在每封电子邮件底部的页脚
备份警报
一个备份警报警报电子邮件将发送给设备在指定天数内没有备份的用户。默认情况下,如果设备3天内未备份,则发送“警告”邮件;如果设备5天内未备份,则发送“紧急”邮件。属性设置天数警报组织设置或者是警报设备备份默认设置.
重置密码(由用户发起)
如果用户忘记他们的Code42密码,他们可以单击忘记了密码Code42应用程序登录页面上的链接。当他们这样做时,密码重置电子邮件就会发送给他们。
自定义邮件内容
这里显示的示例步骤使用旋度是Linux和Mac上用于HTTP通信的命令行工具。其他工具也是可用的。
为了使返回值更易于阅读,这里产生输出的API请求示例包括以下将输出管道到Python JSON解码器:
| python3 -mjson.tool
第一步:给自己发送测试邮件
要查看可用于文本定制的电子邮件,请向自己发送测试电子邮件。
- 登录您的Code42控制台使用您的管理员凭证。
- 新闻Ctrl + Shift + X打开Code42控制台命令行界面(CLI).
- 输入以下内容
test.email
命令为可自定义的每种电子邮件模板发送自己的测试电子邮件。将<用户名>替换为完整的Code42用户名。在CLI中输入一条命令,按“Enter”。测试电子邮件将发送到与用户名关联的电子邮件地址。
test.emailbackup_alerts test.email backup_reports test.email password_reset_user test.email password_reset_admin
步骤2:查看默认邮件内容
电子邮件模板由段.控件可以查看可用的段email-text-customization /视图
API的资源。
调整以下内容email-text-customization /视图
API请求查看所有可以自定义的段的列表。示例如下:
curl -vv -H "Content-Type: application/json" -H "Accept: application/json" -H "authorization: holder< AuthToken >
" "https://console.us.code42.com/api/v4/email-text-customization/view" | python3 -mjson.tool
以下是成功回应的节选。注意“defaultContent”标签指示的文本。这是未自定义段时在电子邮件中使用的默认内容。要查看电子邮件中出现的此内容,请参见电子邮件的例子本文前面所示。
{"metadata": {"date": "2019-02-04T11:01:44.129-06:00", "headers": []}, "data": {"emailTextCustomizations": [{"category": "GLOBAL", "segment": "MESSAGE_FOOTER", "contentType": "SIMPLIFIED_HTML", "defaultContent": "This is a message from Code42. "
100华盛顿大道南套房2000,明尼阿波利斯,MN, 55401 USA
©Code4betway3652软件有限公司,}, {"category": "GLOBAL", "segment": "SENDER_EMAIL", "contentType": "EMAIL_ADDRESS", "defaultContent": "noreply@code42.com",}, {"category": "BACKUP_ALERTS", "segment": "TITLE", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Backup Alert! "
以下设备无法到达任何备份目的地。为减少数据丢失的风险,请按照以下说明操作。
",}, {"category": "BACKUP_ALERTS", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "处理方法:
确保您的设备已连接并在线。然后启动Code42应用程序,单击Run Backup Now。
更多信息,请参阅文档。
",}, {"category": "BACKUP_REPORTS", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "备份状态报告
下面是一个定期的备份状态报告,让您了解设备备份的健康状况。
更多信息,请参阅文档。
",}, {"category": "PASSWORD_RESET_USER", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Reset Your Password
你收到这封邮件是因为你要求重置你的账户密码。如果您没有要求重置密码,请立即与我们联系。
For more information, please see the documentation.
This link can only be used once.
", }, { "category": "PASSWORD_RESET_ADMIN", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Reset Your Password
Your Code42 account administrator has requested a password reset for your account.
Click the following link to reset it.For more information, please see the documentation.
This link can only be used once.
", } ] } }
步骤3:更新邮件内容
您可以通过指定包含自定义的JSON文件来更新电子邮件内容。您可以使用文本编辑器创建JSON文件。
JSON文件只能使用以下内容HTML标记:
- 标题:
-
- 段落:< p >
- 链接:< a href >
- 换行符:< br / >
- 格式:< b >、<我>,< >,< u >, <一口>,<子>,< ins >, < del >, < >, < >, < tt >, <代码>,<大>,<小>,< em >, <李>,< ul >, < ol >
复制前一步的输出,并将其粘贴到用于创建JSON文件的编辑器中。这将构成JSON文件的基础。一定要做到以下几点:
- 删除"data":{}包装。
- 删除“contentType”部分。
- 将“defaultContent”部分重命名为“content”。
- 只包括那些你想要定制的片段。您可以在JSON文件中放置单个段、部分段或所有段。
- 在“content”部分中输入要用于分段的新内容。下面这个例子updateAll.json,包含对所有段的更改。
{"emailTextCustomizations": [{"category": "GLOBAL", "segment": "MESSAGE_FOOTER", "content": "This is a message from Example Corporation, 1234 Anywhere, USA. "版权所有:Example Corporation, Inc.版权所有。”}, {"category": "GLOBAL", "segment": "SENDER_EMAIL", "content": "noreply@example.com"}, {"category": "BACKUP_ALERTS", "segment": "TITLE", "content": "您需要备份。
以下设备无法到达任何备份目的地。按照下面的说明操作。
"}, {"category": "BACKUP_ALERTS", "segment": "BODY", "content": "处理方法:
确保您的设备已连接并在线。然后启动Code42应用程序,单击Run Backup Now。
如果您需要额外的帮助,请拨打Example Corporation的IT帮助热线。
"}, {"category": "BACKUP_REPORTS", "segment": "BODY", "content": "Backup Status Report
以下为设备的备份状态。
"}, {"category": "PASSWORD_RESET_USER", "segment": "BODY", "content": "Reset Your Password
你收到这封邮件是因为你要求重置你的账户密码。 If you did not request a password reset, please contact us immediately.
This link can only be used once.
" }, { "category": "PASSWORD_RESET_ADMIN", "segment": "BODY", "content": "Reset Your Password
Your Code42 account administrator has requested a password reset for your account. Click the following link to reset it.
This link can only be used once.
" } ] }
- 调整以下内容
email-text-customization /更新
API请求更新每个您创建的JSON文件的段。将JSON文件放在运行此命令的目录中,或在“@”命令中提供完整的路径。请记住将替换为您的身份验证令牌,并将console.us.code42.com替换为您的Code42云实例的URL。
示例API请求使用我们的updateAll.json文件:
curl -vv -H "Content-Type: application/json" -H "Accept: application/json" -H "authorization: holder" -d "@updateAll. "json " https://console.us.code42.com/api/v4/email-text-customization/update "
下面是一个成功回应的例子。
> POST /api/v4/email-text-customization/update HTTP/1.1 > Host: console.us.code42.com > Authorization: Basic anBhZG1pbkBleGFtcGxlLmNvbTpqcGFkbWlu > User-Agent: curl/7.47.0 > Content-Type: application/json > Accept: application/json > Content-Length: 1740 > Expect: 100- Continue > < HTTP/1.1 100 Continue} [1740 bytes data]*我们完全上传和良好< HTTP/1.1 204无内容
- 重新运行
email-text-customization /视图
API请求查看您的自定义电子邮件内容。
curl -vv -H "Content-Type: application/json" -H "Accept: application/json" -H "authorization: holder""https://console.us.code42.com/api/v4/email-text-customization/view" | python3 -mjson.tool . sh
下面是一个成功回应的例子。方法中指定的自定义内容updateAll.json文件显示为“customizedContent”标签。
{"metadata": {"date": "2019-02-04T11:01:44.129-06:00", "headers": []}, "data": {"emailTextCustomizations": [{"category": "GLOBAL", "segment": "MESSAGE_FOOTER", "contentType": "SIMPLIFIED_HTML", "defaultContent": "This is a message from Code42. "
100华盛顿大道南套房2000,明尼阿波利斯,MN, 55401 USA
©Code4betway3652软件有限公司", "customizedContent": "这是来自范例公司,1234 Anywhere, USA的信息。版权所有:Example Corporation, Inc.版权所有。”}, {"category": "GLOBAL", "segment": "SENDER_EMAIL", "contentType": "EMAIL_ADDRESS", "defaultContent": "noreply@code42.com", "customizedContent": "noreply@example.com"}, {"category": "BACKUP_ALERTS", "segment": "TITLE", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Backup Alert! "
以下设备无法到达任何备份目的地。为减少数据丢失的风险,请按照以下说明操作。
", "customizedContent": "You need to backup . "
以下设备无法到达任何备份目的地。按照下面的说明操作。
"}, {"category": "BACKUP_ALERTS", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "处理方法:
确保您的设备已连接并在线。 Then launch the Code42 app and click Run Backup Now.
For more information, please see the documentation.
", "customizedContent": "What to do:
Ensure your device is connected and online. Then launch the Code42 app and click Run Backup Now.
If you need additional help, Call Example Corporation's IT help line.
" }, { "category": "BACKUP_REPORTS", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Backup Status Report
Below is a regular backup status report to keep you informed about the health of your devices' backups.
For more information, please see the documentation.
", "customizedContent": "Backup Status Report
Below is the backup status of devices.
" }, { "category": "PASSWORD_RESET_USER", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Reset Your Password
You are receiving this email because you requested a password reset for your account. If you did not request a password reset, please contact us immediately.
For more information, please see the documentation.
This link can only be used once.
", "customizedContent": "Reset Your Password
You are receiving this email because you requested a password reset for your account. If you did not request a password reset, please contact us immediately.
This link can only be used once.
" }, { "category": "PASSWORD_RESET_ADMIN", "segment": "BODY", "contentType": "SIMPLIFIED_HTML", "defaultContent": "Reset Your Password
Your Code42 account administrator has requested a password reset for your account.
Click the following link to reset it.For more information, please see the documentation.
This link can only be used once.
", "customizedContent": "Reset Your Password
Your Code42 account administrator has requested a password reset for your account. Click the following link to reset it.
This link can only be used once.
" } ] } }
步骤4:确认电子邮件使用了您定制的内容
您可以通过发送测试电子邮件来确认您的自定义内容在电子邮件中正确显示。
- 登录您的Code42控制台使用您的管理员凭证。
- 新闻Ctrl + Shift + X打开Code42控制台命令行界面(CLI).
- 输入以下内容
test.email
命令为可自定义的每种电子邮件模板发送自己的测试电子邮件。将admin@example.com替换为您的Code42用户名。在CLI中输入一条命令,按“Enter”。测试电子邮件将发送到与用户名关联的电子邮件地址。
test.emailbackup_alerts test.email backup_reports test.email password_reset_user test.email password_reset_admin
- 打开并检查测试邮件,以确保定制内容正确。
- 如果需要进行任何更改,请在更新JSON文件中进行调整并重新运行
email-text-customization /更新
API。
删除自定义邮件内容
属性可以从电子邮件段中删除自定义内容email-text-customization /删除
API。删除自定义内容的电子邮件段将恢复使用默认电子邮件内容。
- 创建一个JSON文件,其中包含要从中删除自定义内容的电子邮件段列表。下面的示例将恢复所有段。我们将为示例JSON文件命名removeAll.json。
{"emailTextCustomizations": [{"category": "GLOBAL", "segment": "MESSAGE_FOOTER"}, {"category": "GLOBAL", "segment": "SENDER_EMAIL"}, {"category": "BACKUP_ALERTS", "segment": "TITLE"}, {"category": "BACKUP_ALERTS", "segment": "BODY"}, {"category": "BACKUP_REPORTS", "segment": "BODY"}, {"category": "PASSWORD_RESET_USER", "segment": "BODY"}, {"category": "PASSWORD_RESET_ADMIN", "segment": "BODY"}]}
- 调整以下内容
email-text-customization /删除
API请求删除您创建的JSON文件中指定的电子邮件段的自定义内容。将JSON文件放在运行此命令的目录中,或在“@”命令中提供完整的路径。在下面的示例中,记得将替换为您的身份验证令牌,并将console.us.code42.com替换为您的Code42云实例的URL。
curl -vv -H "Content-Type: application/json" -H "Accept: application/json" -H "authorization: holder" -d "@removeAll. "json " https://console.us.code42.com/api/v4/email-text-customization/remove "
成功回应节选:
> POST /api/v4/email-text-customization/remove HTTP/1.1 > Host: console.us.code42.com > Authorization: Basic anBhZG1pbkBleGFtcGxlLmNvbTpqcGFkbWlu > User-Agent: curl/7.47.0 > Content-Type: application/json > Accept: application/json > Content-Length: 173 >} [173 bytes data]* upload completely sent off: 434字节中的434字节< HTTP/1.1 204 No Content
- 重新运行
email-text-customization /视图
API请求查看还原的电子邮件内容。
curl -vv -H "Content-Type: application/json" -H "Accept: application/json" -H "authorization: holder" "https://console.us.code42.com/api/v4/email-text-customization/view" | python3 -mjson.tool . sh
请注意,在输出中没有带有“customizedContent”标签的电子邮件段。相反,它们只显示“defaultContent”标签。以下摘录显示了输出中的前两段:
{"metadata": {"date": "2019-02-04T11:01:44.129-06:00", "headers": []}, "data": {"emailTextCustomizations": [{"category": "GLOBAL", "segment": "MESSAGE_FOOTER", "contentType": "SIMPLIFIED_HTML", "defaultContent": "This is a message from Code42. "
100华盛顿大道南套房2000,明尼阿波利斯,MN, 55401 USA
©Code4betway3652软件有限公司版权所有。”}, {"category": "GLOBAL", "segment": "SENDER_EMAIL", "contentType": "EMAIL_ADDRESS", "defaultContent": "noreply@code42.com"},…
自定义邮件logo
您可以使用EmailLogoCustomization
API资源用于在电子邮件中将贵公司的标志插入到Code4betway88help2标志旁边。您的标志必须符合以下标准:
- 格式:JPEG或PNG
- 最大高度:36个像素
- 最大宽度:121像素
添加你的logo
- 在以下示例中,将
替换为an身份验证令牌,并将CompanyLogobetway88help.png替换为logo文件的名称。将logo文件放在运行此命令的目录中,或在“@”命令中提供完整路径。将console.us.code42.com替换为Code42云实例的URL。
curl -vv -X POST -H "authorization: holder" -H "Content-Type: multipart/form-data"——form "logo=@Cbetway88helpompanyLogo.png" "https://console.us.code42.com/api/v3/EmailLogoCustomization"
要验证徽标已成功添加,请调整以下授权请求以检索系统中的徽标。
在下面的示例中,将CopyOfMyCompanyLogo.png替换为您希望保存lobetway88helpgo副本的文件名,并将console.us.code42.com替换为您的Code42云实例的URL。
curl -vv -X GET -H "authorization: holder" -o CopyOfMybetway88helpCompanyLogo.png "https://console.us.code42.com/api/v3/EmailLogoCustomization"
检索徽标并将其放入您指定的文件名中。检索文件的内容类型在输出中显示为“content - type: image/png”。如果检索到的文件类型与文件名中指定的文件类型不同,请在检索后将文件名后缀更改为正确的文件类型。
- 为了确认你的新logo在电子邮件中正确显示,给自己发送测试邮件。
- 登录您的Code42控制台使用您的管理员凭证。
- 新闻Ctrl + Shift + X打开Code42控制台命令行界面(CLI).
- 输入以下内容
test.email
命令为可自定义的每种电子邮件模板发送自己的测试电子邮件。取代admin@example.com使用您的Code42用户名。在CLI中输入一条命令,按“”输入.测试电子邮件将发送到与用户名关联的电子邮件地址。
test.emailbackup_alerts test.email backup_reports test.email password_reset_user test.email password_reset_admin
- 打开并检查测试电子邮件,以确保徽标正确显示。
更新logo
调整下面的API命令来更新logo。在下面的示例中,将NewCompanyLogo.png替换为logo文件的betway88help名称。将logo文件放在运行此命令的目录中,或在“@”命令中提供完整路径。将console.us.code42.com替换为Code42云实例的URL。
curl -vv -X PUT -H "authorization: holder" -H "Content-Type: multipart/form-data"——form "logo=@NewCbetway88helpompanyLogo.png" "https://console.us.code42.com/api/v3/EmailLogoCustomization"
删除logo
调整以下API命令从电子邮件中删除您的徽标。在下面的示例中,将console.us.code42.com替换为Code42云实例的URL。运行此命令后,电子邮件中只出现Code42徽标。
curl -vv -X DELETE -H "authorization: holder" "https://console.us.code42.com/api/v3/EmailLogoCustomization"