EmailTemplate
With Auth0, you can have standard welcome, password reset, and account verification email-based workflows built right into Auth0. This resource allows you to configure email templates to customize the look, feel, and sender identities of emails sent by Auth0. Used in conjunction with configured email providers.
Example Usage
using Pulumi;
using Auth0 = Pulumi.Auth0;
class MyStack : Stack
{
public MyStack()
{
var myEmailProvider = new Auth0.Email("myEmailProvider", new Auth0.EmailArgs
{
Enabled = true,
DefaultFromAddress = "accounts@example.com",
Credentials = new Auth0.Inputs.EmailCredentialsArgs
{
AccessKeyId = "AKIAXXXXXXXXXXXXXXXX",
SecretAccessKey = "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
Region = "us-east-1",
},
});
var myEmailTemplate = new Auth0.EmailTemplate("myEmailTemplate", new Auth0.EmailTemplateArgs
{
Template = "welcome_email",
Body = "<html><body><h1>Welcome!</h1></body></html>",
From = "welcome@example.com",
ResultUrl = "https://example.com/welcome",
Subject = "Welcome",
Syntax = "liquid",
UrlLifetimeInSeconds = 3600,
Enabled = true,
});
}
}
Coming soon!
import pulumi
import pulumi_auth0 as auth0
my_email_provider = auth0.Email("myEmailProvider",
enabled=True,
default_from_address="accounts@example.com",
credentials={
"accessKeyId": "AKIAXXXXXXXXXXXXXXXX",
"secretAccessKey": "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"region": "us-east-1",
})
my_email_template = auth0.EmailTemplate("myEmailTemplate",
template="welcome_email",
body="<html><body><h1>Welcome!</h1></body></html>",
from_="welcome@example.com",
result_url="https://example.com/welcome",
subject="Welcome",
syntax="liquid",
url_lifetime_in_seconds=3600,
enabled=True)import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";
const myEmailProvider = new auth0.Email("myEmailProvider", {
enabled: true,
defaultFromAddress: "accounts@example.com",
credentials: {
accessKeyId: "AKIAXXXXXXXXXXXXXXXX",
secretAccessKey: "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
region: "us-east-1",
},
});
const myEmailTemplate = new auth0.EmailTemplate("myEmailTemplate", {
template: "welcome_email",
body: "<html><body><h1>Welcome!</h1></body></html>",
from: "welcome@example.com",
resultUrl: "https://example.com/welcome",
subject: "Welcome",
syntax: "liquid",
urlLifetimeInSeconds: 3600,
enabled: true,
});Create a EmailTemplate Resource
new EmailTemplate(name: string, args: EmailTemplateArgs, opts?: CustomResourceOptions);def EmailTemplate(resource_name, opts=None, body=None, enabled=None, from_=None, result_url=None, subject=None, syntax=None, template=None, url_lifetime_in_seconds=None, __props__=None);func NewEmailTemplate(ctx *Context, name string, args EmailTemplateArgs, opts ...ResourceOption) (*EmailTemplate, error)public EmailTemplate(string name, EmailTemplateArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
EmailTemplate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The EmailTemplate resource accepts the following input properties:
- Body string
String. Body of the email template. You can include common variables.
- Enabled bool
Boolean. Indicates whether or not the template is enabled.
- From string
String. Email address to use as the sender. You can include common variables.
- Subject string
String. Subject line of the email. You can include common variables.
- Syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- Template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- Result
Url string String. URL to redirect the user to after a successful action. Learn more.
- Url
Lifetime intIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- Body string
String. Body of the email template. You can include common variables.
- Enabled bool
Boolean. Indicates whether or not the template is enabled.
- From string
String. Email address to use as the sender. You can include common variables.
- Subject string
String. Subject line of the email. You can include common variables.
- Syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- Template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- Result
Url string String. URL to redirect the user to after a successful action. Learn more.
- Url
Lifetime intIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- body string
String. Body of the email template. You can include common variables.
- enabled boolean
Boolean. Indicates whether or not the template is enabled.
- from string
String. Email address to use as the sender. You can include common variables.
- subject string
String. Subject line of the email. You can include common variables.
- syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- result
Url string String. URL to redirect the user to after a successful action. Learn more.
- url
Lifetime numberIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- body str
String. Body of the email template. You can include common variables.
- enabled bool
Boolean. Indicates whether or not the template is enabled.
- from_ str
String. Email address to use as the sender. You can include common variables.
- subject str
String. Subject line of the email. You can include common variables.
- syntax str
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- template str
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- result_
url str String. URL to redirect the user to after a successful action. Learn more.
- url_
lifetime_ floatin_ seconds Integer. Number of seconds during which the link within the email will be valid.
Outputs
All input properties are implicitly available as output properties. Additionally, the EmailTemplate resource produces the following output properties:
Look up an 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): EmailTemplatestatic get(resource_name, id, opts=None, body=None, enabled=None, from_=None, result_url=None, subject=None, syntax=None, template=None, url_lifetime_in_seconds=None, __props__=None);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)- 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.
The following state arguments are supported:
- Body string
String. Body of the email template. You can include common variables.
- Enabled bool
Boolean. Indicates whether or not the template is enabled.
- From string
String. Email address to use as the sender. You can include common variables.
- Result
Url string String. URL to redirect the user to after a successful action. Learn more.
- Subject string
String. Subject line of the email. You can include common variables.
- Syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- Template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- Url
Lifetime intIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- Body string
String. Body of the email template. You can include common variables.
- Enabled bool
Boolean. Indicates whether or not the template is enabled.
- From string
String. Email address to use as the sender. You can include common variables.
- Result
Url string String. URL to redirect the user to after a successful action. Learn more.
- Subject string
String. Subject line of the email. You can include common variables.
- Syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- Template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- Url
Lifetime intIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- body string
String. Body of the email template. You can include common variables.
- enabled boolean
Boolean. Indicates whether or not the template is enabled.
- from string
String. Email address to use as the sender. You can include common variables.
- result
Url string String. URL to redirect the user to after a successful action. Learn more.
- subject string
String. Subject line of the email. You can include common variables.
- syntax string
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- template string
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- url
Lifetime numberIn Seconds Integer. Number of seconds during which the link within the email will be valid.
- body str
String. Body of the email template. You can include common variables.
- enabled bool
Boolean. Indicates whether or not the template is enabled.
- from_ str
String. Email address to use as the sender. You can include common variables.
- result_
url str String. URL to redirect the user to after a successful action. Learn more.
- subject str
String. Subject line of the email. You can include common variables.
- syntax str
String. Syntax of the template body. You can use either text or HTML + Liquid syntax.
- template str
String. Template name. Options include
verify_email,reset_email,welcome_email,blocked_account,stolen_credentials,enrollment_email,mfa_oob_code,change_password(legacy), andpassword_reset(legacy).- url_
lifetime_ floatin_ seconds Integer. Number of seconds during which the link within the email will be valid.
Package Details
- Repository
- https://github.com/pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0Terraform Provider.