Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
email-templates
/
{templateName}
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.EmailTemplates.UpdateAsync(
            templateName: EmailTemplateNameEnum.VerifyEmail,
            request: new UpdateEmailTemplateRequestContent()
        );
    }

}
package example

import (
context "context"

management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.UpdateEmailTemplateRequestContent{}
client.EmailTemplates.Update(
context.TODO(),
management.EmailTemplateNameEnumVerifyEmail.Ptr(),
request,
)
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.resources.emailtemplates.requests.UpdateEmailTemplateRequestContent;
import com.auth0.client.mgmt.types.EmailTemplateNameEnum;

public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();

client.emailTemplates().update(
EmailTemplateNameEnum.VERIFY_EMAIL,
UpdateEmailTemplateRequestContent
.builder()
.build()
);
}
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\EmailTemplateNameEnum;
use Auth0\SDK\API\Management\EmailTemplates\Requests\UpdateEmailTemplateRequestContent;

$client = new Management(
token: '<token>',
);
$client->emailTemplates->update(
EmailTemplateNameEnum::VerifyEmail->value,
new UpdateEmailTemplateRequestContent([]),
);
from auth0.management import ManagementClient

client = ManagementClient(
token="<token>",
)

client.email_templates.update(
template_name="verify_email",
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.email_templates.update(template_name: "verify_email")
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.emailTemplates.update("verify_email", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.emailTemplates.update("verify_email", {});
}
main();
curl --request PATCH \
--url https://{tenantDomain}/api/v2/email-templates/{templateName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": "verify_email",
"body": "<string>",
"from": "sender@auth0.com",
"resultUrl": "<string>",
"subject": "<string>",
"syntax": "liquid",
"urlLifetimeInSeconds": 1,
"includeEmailInRedirect": true,
"enabled": true
}
'
{
  "template": "verify_email",
  "body": "<string>",
  "from": "sender@auth0.com",
  "resultUrl": "<string>",
  "subject": "<string>",
  "syntax": "liquid",
  "urlLifetimeInSeconds": 1,
  "includeEmailInRedirect": true,
  "enabled": true
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

templateName
enum<string>
défaut:verify_email
requis

Template name. Can be verify_email, verify_email_by_code, auth_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, async_approval, change_password (legacy), or password_reset (legacy).

Options disponibles:
verify_email,
verify_email_by_code,
auth_email_by_code,
reset_email,
reset_email_by_code,
welcome_email,
blocked_account,
stolen_credentials,
enrollment_email,
mfa_oob_code,
user_invitation,
change_password,
password_reset,
async_approval

Corps

template
enum<string>
défaut:verify_email

Template name. Can be verify_email, verify_email_by_code, auth_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, async_approval, change_password (legacy), or password_reset (legacy).

Options disponibles:
verify_email,
verify_email_by_code,
auth_email_by_code,
reset_email,
reset_email_by_code,
welcome_email,
blocked_account,
stolen_credentials,
enrollment_email,
mfa_oob_code,
user_invitation,
change_password,
password_reset,
async_approval
body
string | null

Body of the email template.

from
string | null
défaut:sender@auth0.com

Senders from email address.

resultUrl
string | null

URL to redirect the user to after a successful action.

subject
string | null

Subject line of the email.

syntax
string | null
défaut:liquid

Syntax of the template body.

urlLifetimeInSeconds
number | null

Lifetime in seconds that the link within the email will be valid for.

Plage requise: x >= 0
includeEmailInRedirect
boolean

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

enabled
boolean | null

Whether the template is enabled (true) or disabled (false).

Réponse

Template successfully updated.

template
enum<string>
défaut:verify_email

Template name. Can be verify_email, verify_email_by_code, auth_email_by_code, reset_email, reset_email_by_code, welcome_email, blocked_account, stolen_credentials, enrollment_email, mfa_oob_code, user_invitation, async_approval, change_password (legacy), or password_reset (legacy).

Options disponibles:
verify_email,
verify_email_by_code,
auth_email_by_code,
reset_email,
reset_email_by_code,
welcome_email,
blocked_account,
stolen_credentials,
enrollment_email,
mfa_oob_code,
user_invitation,
change_password,
password_reset,
async_approval
body
string | null

Body of the email template.

from
string | null
défaut:sender@auth0.com

Senders from email address.

resultUrl
string | null

URL to redirect the user to after a successful action.

subject
string | null

Subject line of the email.

syntax
string | null
défaut:liquid

Syntax of the template body.

urlLifetimeInSeconds
number | null

Lifetime in seconds that the link within the email will be valid for.

Plage requise: x >= 0
includeEmailInRedirect
boolean

Whether the reset_email and verify_email templates should include the user's email address as the email parameter in the returnUrl (true) or whether no email address should be included in the redirect (false). Defaults to true.

enabled
boolean | null

Whether the template is enabled (true) or disabled (false).