Skip to content

Commit 9ae44aa

Browse files
authored
Update custom-email.md
Adding the localize your email section
1 parent fb8dca6 commit 9ae44aa

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

articles/active-directory-b2c/custom-email.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: celestedg
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: reference
12-
ms.date: 12/18/2019
12+
ms.date: 02/05/2020
1313
ms.author: marsma
1414
ms.subservice: B2C
1515
---
@@ -387,6 +387,38 @@ For more information, see [Self-asserted technical profile](restful-technical-pr
387387
</ClaimsProvider>
388388
```
389389

390+
## [Optional] Localize your email
391+
392+
The `GenerateSendGridRequestBody` claims transformation which generates the JSON payload, uses input claims that contain dynamic values (such as the email address and the OTP code), and static values (such as the template name, and email subject).
393+
394+
To localize the email, you must send localized strings to SendGrid, or your email provider. For example to localize the email subject, body, your code message, and signature of the email. To do so, you can use the [GetLocalizedStringsTransformation](string-transformations.md) claims transformation to copy localized strings into claim types.
395+
396+
1. In your policy define the following string claims: subject, message, codeIntro and signature.
397+
1. Define a [GetLocalizedStringsTransformation](string-transformations.md) claims transformation to substitute localized string values into the claims from step 1.
398+
1. Change the `GenerateSendGridRequestBody` technical profile to use input claims with the following XML snippet.
399+
1. Update your SendGrind template to use dynamic parameters in place of all the strings which will be localized by Azure AD B2C.
400+
401+
```XML
402+
<ClaimsTransformation Id="GenerateSendGridRequestBody" TransformationMethod="GenerateJson">
403+
<InputClaims>
404+
<InputClaim ClaimTypeReferenceId="email" TransformationClaimType="personalizations.0.to.0.email" />
405+
<InputClaim ClaimTypeReferenceId="subject" TransformationClaimType="personalizations.0.dynamic_template_data.subject" />
406+
<InputClaim ClaimTypeReferenceId="otp" TransformationClaimType="personalizations.0.dynamic_template_data.otp" />
407+
<InputClaim ClaimTypeReferenceId="email" TransformationClaimType="personalizations.0.dynamic_template_data.email" />
408+
<InputClaim ClaimTypeReferenceId="message" TransformationClaimType="personalizations.0.dynamic_template_data.message" />
409+
<InputClaim ClaimTypeReferenceId="codeIntro" TransformationClaimType="personalizations.0.dynamic_template_data.codeIntro" />
410+
<InputClaim ClaimTypeReferenceId="signature" TransformationClaimType="personalizations.0.dynamic_template_data.signature" />
411+
</InputClaims>
412+
<InputParameters>
413+
<InputParameter Id="template_id" DataType="string" Value="d-1234567890" />
414+
<InputParameter Id="from.email" DataType="string" Value="[email protected]" />
415+
</InputParameters>
416+
<OutputClaims>
417+
<OutputClaim ClaimTypeReferenceId="sendGridReqBody" TransformationClaimType="outputClaim" />
418+
</OutputClaims>
419+
</ClaimsTransformation>
420+
```
421+
390422
## Next steps
391423

392424
You can find an example of a custom email verification policy on GitHub:

0 commit comments

Comments
 (0)