メールへのプロファイル属性値の表示

このサンプルのサーバーサイド JavaScript は、購読者のプロファイル属性をメールメッセージ内に表示する方法を示しています。

サンプルコード 

このサンプルコードでは、2 つのプロファイル属性の値を使用してサーバーサイド JavaScript 変数を作成し、それをメールに表示する方法について説明します。

1<script runat=server>
2    var subFullName = Platform.Recipient.GetAttributeValue("First Name") + " " + Platform.Recipient.GetAttributeValue("Last Name");
3</script>
4<br />
5<br />
6Hello <ctrl:var name="subFullName" />,
7The subFullName variable contains the information taken from the First Name and Last Name profile attributes.
8
9This sample code demonstrates how to display the value of the profile attributes directly in the email:
10
11Dear <ctrl:field name="First Name" />,
12<br />
13Your email address is <ctrl:field name="emailaddr" />.