Newer Version Available

This content describes an older version of this product. View Latest

Email Template (POST)

Create an email template. The Health Cloud Starter and Life Sciences Commercial Admin Permission Sets are required for accessing this API. To know more, see Email Template and Intelligent Content.
Resource
1/connect/life-sciences/commercial/bulk-email-template
Resource example
1https://yourInstance.salesforce.com/services/data/v66.0/connect/life-sciences/commercial/bulk-email-template
Available version
65.0
HTTP methods
POST
  • File input payload size: The total file input payload size in an API call cannot exceed 2 GB
  • Rate limits: The rate limit for Email Template APIs (POST and PATCH) is 200 API calls per org per hour.

Note

Request body for POST
1{
2    "emailSubject": "Welcome",
3    "contentDocumentId": "069xx0000004CAeAAM",
4    "name": "Welcome Email",
5    "activatedDate": "2025-06-03T15:00:00.000Z",
6    "senderType": "SYSTEM",
7    "senderEmailFieldAPIName": "noreply@company.com",
8    "replyToType": "USER",
9    "replyToEmailAddress": "support@company.com",
10    "id": "external-id",
11    "deactivatedDate": "2025-01-01T00:00:00.000Z",
12    "description": "This is a welcome email template used for onboarding new users.",
13    "attachmentObjectTypes": [
14        "PDF",
15        "DOCX"
16    ],
17    "customFields": [
18        {
19            "fieldName": "user",
20            "fieldValue": "admin"
21        },
22        {
23            "fieldName": "standard",
24            "fieldValue": "user"
25        }
26    ],
27    "languages": [
28        "en",
29        "es"
30    ],
31    "isActive": true,
32    "surveyId": "sample-survey-id",
33    "productId": "sample-product-id",
34    "communicationSubscriptionId": "sample-comm-subscription-id",
35    "topics": [
36        "Onboarding",
37        "User Engagement"
38    ],
39    "shouldIgnoreEmailConsent": false,
40    "isSubjectLineEditable": true,
41    "bccEmailIdList": "bcc@example.com",
42    "automatedEmailContextType": "ProviderVisit",
43    "automatedEmailActionType": "Create",
44    "isDefaultAutoEmailTemplate": false
45}
Properties
Property Name Type Description Required
activatedDate Date Date when the email template becomes active. Optional
attachmentObjectTypes List<String> List of object types for attachments. Optional
automatedEmailActionType String Action type for automated emails. Possible values are:
  • Create
  • Update
  • Cancel
Optional
automatedEmailContextType String Context type for automated emails. Possible values are:
  • ProviderVisit
  • Meeting
Optional
bccEmailIdList String Email ID for BCC. Optional
communicationSubscriptionId String ID of the communication subscription associated with the email temaplate. Optional
contentDocumentId String ID of the content document ZIP containing the email files. You can pass this parameter if you wish to process the existing document record. This parameter cannot be provided when you pass the fileId. Required
customFields Object Map of custom field names and their values for the email template. Optional
deactivatedDate Datetime Date when the email template becomes inactive. Optional
description String Description of the email template. Optional
emailSubject String Subject line of the email template. Required, only if the file input is provided either as contentDocumentId or fileId
fileId String The multipart form field key that references the uploaded file for this presentation page. You can pass this parameter if you wish to process a new file that you will include in the request. You cannot provide this parameter when you pass the contentDocumentId as only one of the two are allowed. Required
id String ID of the email template. Either the SourceSystemIdentifier or Salesforce Id of the LifeSciEmailTemplate record. Optional
isActive Boolean Indicates if the email template is active (true) or not (false). Optional
isDefaultAutoEmailTemplate Boolean Indicates if this is a default automated email template (true) or not (false). Optional
isSubjectLineEditable Boolean Indicates if the email subject line is editable (true) or not (false). Optional
languages List<String> List of languages associated with the email template as per the ISO codes such as en_US, fr, es. Optional
name String Name of the email template. Required
productId String ID of the associated product. Optional
replyToEmailAddress String Reply-to email address. Optional
replyToType String Type of reply-to address. Possible values are:
  • SalesRep
  • PredefinedEmail
Optional
senderEmailFieldAPIName String API name of the sender's email field. Optional
senderType String Type of sender for the email. Possible values are:
  • SalesRep
  • PredefinedEmail
Optional
shouldIgnoreEmailConsent Boolean Indicates whether email consent should be ignored (true) or not (false). Optional
surveyId String ID of the associated survey. Optional
topics List<String> List of topics associated with the email template. TopicAssignment for Life Science EmailTemplate must be enabled before using this field. Optional
Response body for POST
Create Email Template Output