ここでは、Metadata API を使用した Lightning メールテンプレートのデプロイ方法を確認します。
まず、これらのメールテンプレートが格納されているフォルダを特定するために 2 つのクエリを使用し、そのフォルダの API 参照名を用いてフォルダを取得します。
クエリ:
Select id, Name, ParentId, DeveloperName from Folder
取得対象の Lightning メールテンプレートの開発者名を見つけるために使用する別の SOQL は次のとおりです。
SELECT Id, Name, developerName, FolderName FROM EmailTemplate
取得:
次に、目的の Lightning メールテンプレートを取得するため、以下と同様の package.xml 形式を使用します。
例:
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>unfiled$public</members>
<name>EmailTemplateFolder</name>
</types>
<types>
<members>unfiled$public/Merrill_Salesforce_Feedback_ET_1693339645628</members>
<name>EmailTemplate</name>
</types>
<version>54.0</version>
</Package>
注意: ここで、「unfiled$public」はパブリックフォルダ名であり、「Merrill_Salesforce_Feedback_ET_1693339645628」はこのフォルダの下にある Lightning メールテンプレートの開発者名です。
ペイロード:
取得を行うと、Lightning メールテンプレートおよびその metadata.xml ファイルを含む zip ファイルが手に入ります。
その後、VS Code でペイロードを選択し、CLI コマンドを使用するか、メールテンプレートフォルダを右クリックしてペイロードをデプロイします。
例: ペイロードのデプロイについては、以下のスクリーンショットを参照してください。
000742641

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.