aws.pinpoint.EmailTemplate
Explore with Pulumi AI
Provides a Pinpoint Email Template resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.pinpoint.EmailTemplate("test", {
templateName: "testing",
emailTemplates: [{
subject: "testing",
textPart: "we are testing template text part",
headers: [{
name: "testingname",
value: "testingvalue",
}],
}],
});
import pulumi
import pulumi_aws as aws
test = aws.pinpoint.EmailTemplate("test",
template_name="testing",
email_templates=[{
"subject": "testing",
"text_part": "we are testing template text part",
"headers": [{
"name": "testingname",
"value": "testingvalue",
}],
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/pinpoint"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pinpoint.NewEmailTemplate(ctx, "test", &pinpoint.EmailTemplateArgs{
TemplateName: pulumi.String("testing"),
EmailTemplates: pinpoint.EmailTemplateEmailTemplateArray{
&pinpoint.EmailTemplateEmailTemplateArgs{
Subject: pulumi.String("testing"),
TextPart: pulumi.String("we are testing template text part"),
Headers: pinpoint.EmailTemplateEmailTemplateHeaderArray{
&pinpoint.EmailTemplateEmailTemplateHeaderArgs{
Name: pulumi.String("testingname"),
Value: pulumi.String("testingvalue"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Pinpoint.EmailTemplate("test", new()
{
TemplateName = "testing",
EmailTemplates = new[]
{
new Aws.Pinpoint.Inputs.EmailTemplateEmailTemplateArgs
{
Subject = "testing",
TextPart = "we are testing template text part",
Headers = new[]
{
new Aws.Pinpoint.Inputs.EmailTemplateEmailTemplateHeaderArgs
{
Name = "testingname",
Value = "testingvalue",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pinpoint.EmailTemplate;
import com.pulumi.aws.pinpoint.EmailTemplateArgs;
import com.pulumi.aws.pinpoint.inputs.EmailTemplateEmailTemplateArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new EmailTemplate("test", EmailTemplateArgs.builder()
.templateName("testing")
.emailTemplates(EmailTemplateEmailTemplateArgs.builder()
.subject("testing")
.textPart("we are testing template text part")
.headers(EmailTemplateEmailTemplateHeaderArgs.builder()
.name("testingname")
.value("testingvalue")
.build())
.build())
.build());
}
}
resources:
test:
type: aws:pinpoint:EmailTemplate
properties:
templateName: testing
emailTemplates:
- subject: testing
textPart: we are testing template text part
headers:
- name: testingname
value: testingvalue
Create EmailTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EmailTemplate(name: string, args: EmailTemplateArgs, opts?: CustomResourceOptions);
@overload
def EmailTemplate(resource_name: str,
args: EmailTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EmailTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
template_name: Optional[str] = None,
email_templates: Optional[Sequence[EmailTemplateEmailTemplateArgs]] = None,
tags: Optional[Mapping[str, str]] = None)
func NewEmailTemplate(ctx *Context, name string, args EmailTemplateArgs, opts ...ResourceOption) (*EmailTemplate, error)
public EmailTemplate(string name, EmailTemplateArgs args, CustomResourceOptions? opts = null)
public EmailTemplate(String name, EmailTemplateArgs args)
public EmailTemplate(String name, EmailTemplateArgs args, CustomResourceOptions options)
type: aws:pinpoint:EmailTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args EmailTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EmailTemplateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EmailTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EmailTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EmailTemplateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var emailTemplateResource = new Aws.Pinpoint.EmailTemplate("emailTemplateResource", new()
{
TemplateName = "string",
EmailTemplates = new[]
{
new Aws.Pinpoint.Inputs.EmailTemplateEmailTemplateArgs
{
DefaultSubstitutions = "string",
Description = "string",
Headers = new[]
{
new Aws.Pinpoint.Inputs.EmailTemplateEmailTemplateHeaderArgs
{
Name = "string",
Value = "string",
},
},
HtmlPart = "string",
RecommenderId = "string",
Subject = "string",
TextPart = "string",
},
},
Tags =
{
{ "string", "string" },
},
});
example, err := pinpoint.NewEmailTemplate(ctx, "emailTemplateResource", &pinpoint.EmailTemplateArgs{
TemplateName: pulumi.String("string"),
EmailTemplates: pinpoint.EmailTemplateEmailTemplateArray{
&pinpoint.EmailTemplateEmailTemplateArgs{
DefaultSubstitutions: pulumi.String("string"),
Description: pulumi.String("string"),
Headers: pinpoint.EmailTemplateEmailTemplateHeaderArray{
&pinpoint.EmailTemplateEmailTemplateHeaderArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
HtmlPart: pulumi.String("string"),
RecommenderId: pulumi.String("string"),
Subject: pulumi.String("string"),
TextPart: pulumi.String("string"),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var emailTemplateResource = new EmailTemplate("emailTemplateResource", EmailTemplateArgs.builder()
.templateName("string")
.emailTemplates(EmailTemplateEmailTemplateArgs.builder()
.defaultSubstitutions("string")
.description("string")
.headers(EmailTemplateEmailTemplateHeaderArgs.builder()
.name("string")
.value("string")
.build())
.htmlPart("string")
.recommenderId("string")
.subject("string")
.textPart("string")
.build())
.tags(Map.of("string", "string"))
.build());
email_template_resource = aws.pinpoint.EmailTemplate("emailTemplateResource",
template_name="string",
email_templates=[{
"default_substitutions": "string",
"description": "string",
"headers": [{
"name": "string",
"value": "string",
}],
"html_part": "string",
"recommender_id": "string",
"subject": "string",
"text_part": "string",
}],
tags={
"string": "string",
})
const emailTemplateResource = new aws.pinpoint.EmailTemplate("emailTemplateResource", {
templateName: "string",
emailTemplates: [{
defaultSubstitutions: "string",
description: "string",
headers: [{
name: "string",
value: "string",
}],
htmlPart: "string",
recommenderId: "string",
subject: "string",
textPart: "string",
}],
tags: {
string: "string",
},
});
type: aws:pinpoint:EmailTemplate
properties:
emailTemplates:
- defaultSubstitutions: string
description: string
headers:
- name: string
value: string
htmlPart: string
recommenderId: string
subject: string
textPart: string
tags:
string: string
templateName: string
EmailTemplate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The EmailTemplate resource accepts the following input properties:
- Template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- Email
Templates List<EmailTemplate Email Template> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Dictionary<string, string>
- Template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- Email
Templates []EmailTemplate Email Template Args - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- map[string]string
- template
Name String - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- email
Templates List<EmailTemplate Email Template> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Map<String,String>
- template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- email
Templates EmailTemplate Email Template[] - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- {[key: string]: string}
- template_
name str - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- email_
templates Sequence[EmailTemplate Email Template Args] - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Mapping[str, str]
- template
Name String - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- email
Templates List<Property Map> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Map<String>
Outputs
All input properties are implicitly available as output properties. Additionally, the EmailTemplate resource produces the following output properties:
Look up Existing EmailTemplate Resource
Get an existing EmailTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EmailTemplateState, opts?: CustomResourceOptions): EmailTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
email_templates: Optional[Sequence[EmailTemplateEmailTemplateArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
template_name: Optional[str] = None) -> EmailTemplate
func GetEmailTemplate(ctx *Context, name string, id IDInput, state *EmailTemplateState, opts ...ResourceOption) (*EmailTemplate, error)
public static EmailTemplate Get(string name, Input<string> id, EmailTemplateState? state, CustomResourceOptions? opts = null)
public static EmailTemplate get(String name, Output<String> id, EmailTemplateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- Amazon Resource Name (ARN) of the message template.
- Email
Templates List<EmailTemplate Email Template> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Dictionary<string, string>
- Dictionary<string, string>
- Template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- Arn string
- Amazon Resource Name (ARN) of the message template.
- Email
Templates []EmailTemplate Email Template Args - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- map[string]string
- map[string]string
- Template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- arn String
- Amazon Resource Name (ARN) of the message template.
- email
Templates List<EmailTemplate Email Template> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Map<String,String>
- Map<String,String>
- template
Name String - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- arn string
- Amazon Resource Name (ARN) of the message template.
- email
Templates EmailTemplate Email Template[] - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- {[key: string]: string}
- {[key: string]: string}
- template
Name string - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- arn str
- Amazon Resource Name (ARN) of the message template.
- email_
templates Sequence[EmailTemplate Email Template Args] - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Mapping[str, str]
- Mapping[str, str]
- template_
name str - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
- arn String
- Amazon Resource Name (ARN) of the message template.
- email
Templates List<Property Map> - Specifies the content and settings for a message template that can be used in messages that are sent through the email channel. See Email Template
- Map<String>
- Map<String>
- template
Name String - name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
Supporting Types
EmailTemplateEmailTemplate, EmailTemplateEmailTemplateArgs
- Default
Substitutions string - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- Description string
- Headers
List<Email
Template Email Template Header> - Html
Part string - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- Recommender
Id string - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- Subject string
- Subject line, or title, to use in email messages that are based on the message template.
- Text
Part string - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
- Default
Substitutions string - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- Description string
- Headers
[]Email
Template Email Template Header - Html
Part string - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- Recommender
Id string - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- Subject string
- Subject line, or title, to use in email messages that are based on the message template.
- Text
Part string - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
- default
Substitutions String - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- description String
- headers
List<Email
Template Email Template Header> - html
Part String - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- recommender
Id String - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- subject String
- Subject line, or title, to use in email messages that are based on the message template.
- text
Part String - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
- default
Substitutions string - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- description string
- headers
Email
Template Email Template Header[] - html
Part string - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- recommender
Id string - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- subject string
- Subject line, or title, to use in email messages that are based on the message template.
- text
Part string - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
- default_
substitutions str - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- description str
- headers
Sequence[Email
Template Email Template Header] - html_
part str - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- recommender_
id str - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- subject str
- Subject line, or title, to use in email messages that are based on the message template.
- text_
part str - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
- default
Substitutions String - JSON object that specifies the default values to use for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable. When you create a message that's based on the template, you can override these defaults with message-specific and address-specific variables and values.
- description String
- headers List<Property Map>
- html
Part String - The message body, in HTML format, to use in email messages that are based on the message template. We recommend using HTML format for email clients that render HTML content. You can include links, formatted text, and more in an HTML message.
- recommender
Id String - The unique identifier for the recommender model to use for the message template. Amazon Pinpoint uses this value to determine how to retrieve and process data from a recommender model when it sends messages that use the template, if the template contains message variables for recommendation data.
- subject String
- Subject line, or title, to use in email messages that are based on the message template.
- text
Part String - Message body, in plain text format, to use in email messages that are based on the message template. We recommend using plain text format for email clients that don't render HTML content and clients that are connected to high-latency networks, such as mobile devices.
EmailTemplateEmailTemplateHeader, EmailTemplateEmailTemplateHeaderArgs
- Name string
- Name of the message header. The header name can contain up to 126 characters.
- Value string
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
- Name string
- Name of the message header. The header name can contain up to 126 characters.
- Value string
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
- name String
- Name of the message header. The header name can contain up to 126 characters.
- value String
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
- name string
- Name of the message header. The header name can contain up to 126 characters.
- value string
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
- name str
- Name of the message header. The header name can contain up to 126 characters.
- value str
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
- name String
- Name of the message header. The header name can contain up to 126 characters.
- value String
- Value of the message header. The header value can contain up to 870 characters, including the length of any rendered attributes. For example if you add the {CreationDate} attribute, it renders as YYYY-MM-DDTHH:MM:SS.SSSZ and is 24 characters in length.
Import
Using pulumi import
, import Pinpoint Email Template using the template_name
. For example:
$ pulumi import aws:pinpoint/emailTemplate:EmailTemplate reset template_name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.