Du er her:
Utforme e-postmeldingen i Innholdsbygger
La oss gå gjennom trinnene for å opprette den første velkomstmeldingen i denne kampanjen.
- Gå til Innholdsbygger i Marketing Cloud-engasjement.
- For å opprette e-postmeldingen klikker du på + Opprett og E-postmelding.
-
Velg mal for e-postopprettingsmetoden.
E-postmeldinger kan opprettes på mange måter i Innholdsbygger, inkludert fra en mal eller HTML-kode. I dette eksemplet forklarer vi hvordan du oppretter en e-postmelding fra en mal.
- Velg ønsket mal og klikk på Velg.
- Definer e-postegenskaper, inkludert et e-postnavn og en beskrivelse, og klikk på Neste
-
Hvis du vil bruke tilpassingen i datautvidelsen Data 360, drar du en kodesnuttsblokk til e-postlerretet.
- I dette brukstilfellet inkluderer de tilpassede elementene kundens fornavn, forsikringspolisenummer, polisetype og polisestartdato. Kod innholdet med GTL, SSJS eller AMPscript for å bruke det JSON-formaterte innholdet i datautvidelsen.
-
Klikk på Forhåndsvis og test, og velg datautvidelsen fra Data 360.

- Etter testing klikker du på Lagre og avslutt.
- Utfør disse trinnene for de resterende to e-postmeldingene.
Du kan analysere disse dataene med enten GTL, SSJS eller AMPscript.
%%[ set @JSONData = [RA_PolicyInformation_02] ]%%
{{.datasource RA_PolicyInformation_02 type=variable}}
{{.data}}
{ "target" : "@JSONData"}
{{/data}}
<b>Verify Your Information</b><br />
Please take a moment to review your information.<br />
<br />
<b>Insurance Policy Number</b>: {{RA_PolicyInformation_02.policy_number}}<br />
<br />
<b>Policy Type</b>: {{RA_PolicyInformation_02.product_type}}<br />
<br />
{{.datasource RA_PolicyProducts type=nested}}
{{.data}}
{ "target" : "RA_PolicyInformation_02.RA_PolicyProducts" }
{{/data}}
<b>Insured Asset Make:</b> {{RA_PolicyProducts.productId}}<br />
<br />
<b>Here's everyone included in your policy:</b><br />
{{.datasource RA_Account type=nested}}
{{.data}}
{ "target" : "RA_PolicyProducts.RA_Account02" }
{{/data}}
{{RA_Account.membername}}<br />
{{/datasource}}
{{/datasource}}
{{/datasource}}
Eksempel på SSJS-tolking
<script runat="server">
Platform.Load("core","1");
var JSONblock = Platform.Recipient.GetAttributeValue("RA_PolicyInformation");
var JsonData = Platform.Function.ParseJSON(JSONblock);
for (var i=0; i<JsonData.length; ++i) {
var RA_PolicyInformation_02 = JsonData[i];
Platform.Response.Write('<b>Verify Your Information</b><br />');
Platform.Response.Write('Please take a moment to review your information.<br />');
Platform.Response.Write('<br />');
Platform.Response.Write('<b>Insurance Policy Number</b>: ' + RA_PolicyInformation_02['policy_number'] + '<br />');
Platform.Response.Write('<br />');
Platform.Response.Write('<b>Policy Type</b>: ' + RA_PolicyInformation_02['product_type'] + '<br />');
Platform.Response.Write('<br />');
var RA_PolicyProducts = RA_PolicyInformation_02['RA_PolicyProducts'];
for (var j=0; j<RA_PolicyProducts.length; ++j) {
RA_PolicyProduct = RA_PolicyProducts[j];
Platform.Response.Write('<b>Insured Asset Make:</b> ' + RA_PolicyProduct['productId'] + '<br />');
Platform.Response.Write('<br />');
Platform.Response.Write('<b>Here\'s everyone included in your policy:</b><br />');
var RA_Account02 = RA_PolicyProduct['RA_Account02'];
for (var k=0; k<RA_Account02.length; ++k) {
RA_Account = RA_Account02[k];
Platform.Response.Write(RA_Account['membername'] + '<br />');
}
}
}
</script>
Eksempel på AMPscript-tolking
%%[
var @i, @j, @k, @PolicyRowset, @PolicyCount, @PolicyRow, @PolicyNumber, @ProductType, @PolicyProductsRowset, @PolicyProductCount, @PolicyProductRow, @PolicyProductId, @MemberRowset, @MemberCount, @MemberRow, @MemberName
set @PolicyRowset=BuildRowsetFromJson(RA_PolicyInformation,"$.[*]", false)
set @PolicyCount=rowcount(@PolicyRowset)
for @i = 1 to @PolicyCount do
set @PolicyRow=row(@PolicyRowset, @i)
set @PolicyNumber=field(@PolicyRow, "policy_number")
set @ProductType=field(@PolicyRow, "product_type")
OutputLine(V("<b>Verify Your Information</b><br />"))
OutputLine(V("Please take a moment to review your information.<br />"))
OutputLine(V("<br />"))
OutputLine(concat("<b>Insurance Policy Number</b>: ", @PolicyNumber, "<br />"));
OutputLine(V("<br />"));
OutputLine(concat("<b>Policy Type</b>: ", @ProductType, "<br />"));
OutputLine(V("<br />"));
set @PolicyProductsRowset = BuildRowsetFromJson(RA_PolicyInformation, concat("$.[", Subtract(@i, 1), "].RA_PolicyProducts[*]"), false)
set @PolicyProductCount = rowcount(@PolicyProductsRowset)
for @j = 1 to @PolicyProductCount do
set @PolicyProductRow=row(@PolicyProductsRowset, @j)
set @PolicyProductId=field(@PolicyProductRow, "productId")
OutputLine(concat("<b>Insured Asset Make:</b>", @PolicyProductId, "<br />"));
OutputLine(V("<br />"));
OutputLine(V("<b>Here's everyone included in your policy:</b><br />"));
set @MemberRowset = BuildRowsetFromJson(RA_PolicyInformation, concat("$.[", Subtract(@i, 1), "].RA_PolicyProducts[", Subtract(@j, 1), "].RA_Account02[*]"), false)
set @MemberCount = rowcount(@MemberRowset)
for @k = 1 to @MemberCount do
set @MemberRow=row(@MemberRowset, @k)
set @MemberName=field(@MemberRow, "membername")
OutputLine(concat(@MemberName, "<br />"));
next @k
next @j
next @i
]%%
