Skip to content

Commit adee5f1

Browse files
authored
Merge pull request #103450 from yoelhor/patch-1
Update custom-email.md
2 parents 4353e9d + 2be5d09 commit adee5f1

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

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

Lines changed: 31 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,36 @@ For more information, see [Self-asserted technical profile](restful-technical-pr
387387
</ClaimsProvider>
388388
```
389389

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

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

0 commit comments

Comments
 (0)