1. Packages
  2. Ibm Provider
  3. API Docs
  4. AppidCloudDirectoryTemplate
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.AppidCloudDirectoryTemplate

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, or reset an IBM Cloud AppID Management Services Cloud Directory email templates. For more information, see customizing emails

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as ibm from "@pulumi/ibm";
    
    const tpl = new ibm.AppidCloudDirectoryTemplate("tpl", {
        tenantId: _var.tenant_id,
        templateName: "USER_VERIFICATION",
        subject: "Please Verify Your Email Address %{user.displayName}",
        htmlBody: fs.readFileSync("path/to/body.html", "utf8"),
        plainTextBody: fs.readFileSync("path/to/body.txt", "utf8"),
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    tpl = ibm.AppidCloudDirectoryTemplate("tpl",
        tenant_id=var["tenant_id"],
        template_name="USER_VERIFICATION",
        subject="Please Verify Your Email Address %{user.displayName}",
        html_body=(lambda path: open(path).read())("path/to/body.html"),
        plain_text_body=(lambda path: open(path).read())("path/to/body.txt"))
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewAppidCloudDirectoryTemplate(ctx, "tpl", &ibm.AppidCloudDirectoryTemplateArgs{
    			TenantId:      pulumi.Any(_var.Tenant_id),
    			TemplateName:  pulumi.String("USER_VERIFICATION"),
    			Subject:       pulumi.String("Please Verify Your Email Address %{user.displayName}"),
    			HtmlBody:      pulumi.String(readFileOrPanic("path/to/body.html")),
    			PlainTextBody: pulumi.String(readFileOrPanic("path/to/body.txt")),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var tpl = new Ibm.AppidCloudDirectoryTemplate("tpl", new()
        {
            TenantId = @var.Tenant_id,
            TemplateName = "USER_VERIFICATION",
            Subject = "Please Verify Your Email Address %{user.displayName}",
            HtmlBody = File.ReadAllText("path/to/body.html"),
            PlainTextBody = File.ReadAllText("path/to/body.txt"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.AppidCloudDirectoryTemplate;
    import com.pulumi.ibm.AppidCloudDirectoryTemplateArgs;
    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 tpl = new AppidCloudDirectoryTemplate("tpl", AppidCloudDirectoryTemplateArgs.builder()
                .tenantId(var_.tenant_id())
                .templateName("USER_VERIFICATION")
                .subject("Please Verify Your Email Address %{user.displayName}")
                .htmlBody(Files.readString(Paths.get("path/to/body.html")))
                .plainTextBody(Files.readString(Paths.get("path/to/body.txt")))
                .build());
    
        }
    }
    
    resources:
      tpl:
        type: ibm:AppidCloudDirectoryTemplate
        properties:
          tenantId: ${var.tenant_id}
          templateName: USER_VERIFICATION
          subject: Please Verify Your Email Address %{user.displayName}
          # note: `%{` has to be escaped, otherwise it will be treated as terraform template directive
          htmlBody:
            fn::readFile: path/to/body.html
          # no need to escape %{} within the template files
          plainTextBody:
            fn::readFile: path/to/body.txt
    

    Create AppidCloudDirectoryTemplate Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AppidCloudDirectoryTemplate(name: string, args: AppidCloudDirectoryTemplateArgs, opts?: CustomResourceOptions);
    @overload
    def AppidCloudDirectoryTemplate(resource_name: str,
                                    args: AppidCloudDirectoryTemplateArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def AppidCloudDirectoryTemplate(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    subject: Optional[str] = None,
                                    template_name: Optional[str] = None,
                                    tenant_id: Optional[str] = None,
                                    appid_cloud_directory_template_id: Optional[str] = None,
                                    html_body: Optional[str] = None,
                                    language: Optional[str] = None,
                                    plain_text_body: Optional[str] = None)
    func NewAppidCloudDirectoryTemplate(ctx *Context, name string, args AppidCloudDirectoryTemplateArgs, opts ...ResourceOption) (*AppidCloudDirectoryTemplate, error)
    public AppidCloudDirectoryTemplate(string name, AppidCloudDirectoryTemplateArgs args, CustomResourceOptions? opts = null)
    public AppidCloudDirectoryTemplate(String name, AppidCloudDirectoryTemplateArgs args)
    public AppidCloudDirectoryTemplate(String name, AppidCloudDirectoryTemplateArgs args, CustomResourceOptions options)
    
    type: ibm:AppidCloudDirectoryTemplate
    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 AppidCloudDirectoryTemplateArgs
    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 AppidCloudDirectoryTemplateArgs
    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 AppidCloudDirectoryTemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AppidCloudDirectoryTemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AppidCloudDirectoryTemplateArgs
    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 appidCloudDirectoryTemplateResource = new Ibm.AppidCloudDirectoryTemplate("appidCloudDirectoryTemplateResource", new()
    {
        Subject = "string",
        TemplateName = "string",
        TenantId = "string",
        AppidCloudDirectoryTemplateId = "string",
        HtmlBody = "string",
        Language = "string",
        PlainTextBody = "string",
    });
    
    example, err := ibm.NewAppidCloudDirectoryTemplate(ctx, "appidCloudDirectoryTemplateResource", &ibm.AppidCloudDirectoryTemplateArgs{
    	Subject:                       pulumi.String("string"),
    	TemplateName:                  pulumi.String("string"),
    	TenantId:                      pulumi.String("string"),
    	AppidCloudDirectoryTemplateId: pulumi.String("string"),
    	HtmlBody:                      pulumi.String("string"),
    	Language:                      pulumi.String("string"),
    	PlainTextBody:                 pulumi.String("string"),
    })
    
    var appidCloudDirectoryTemplateResource = new AppidCloudDirectoryTemplate("appidCloudDirectoryTemplateResource", AppidCloudDirectoryTemplateArgs.builder()
        .subject("string")
        .templateName("string")
        .tenantId("string")
        .appidCloudDirectoryTemplateId("string")
        .htmlBody("string")
        .language("string")
        .plainTextBody("string")
        .build());
    
    appid_cloud_directory_template_resource = ibm.AppidCloudDirectoryTemplate("appidCloudDirectoryTemplateResource",
        subject="string",
        template_name="string",
        tenant_id="string",
        appid_cloud_directory_template_id="string",
        html_body="string",
        language="string",
        plain_text_body="string")
    
    const appidCloudDirectoryTemplateResource = new ibm.AppidCloudDirectoryTemplate("appidCloudDirectoryTemplateResource", {
        subject: "string",
        templateName: "string",
        tenantId: "string",
        appidCloudDirectoryTemplateId: "string",
        htmlBody: "string",
        language: "string",
        plainTextBody: "string",
    });
    
    type: ibm:AppidCloudDirectoryTemplate
    properties:
        appidCloudDirectoryTemplateId: string
        htmlBody: string
        language: string
        plainTextBody: string
        subject: string
        templateName: string
        tenantId: string
    

    AppidCloudDirectoryTemplate 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 AppidCloudDirectoryTemplate resource accepts the following input properties:

    Subject string
    The subject
    TemplateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    TenantId string
    The AppID instance GUID
    AppidCloudDirectoryTemplateId string
    HtmlBody string
    The HTML body
    Language string
    Select language for the template. Format as described at RFC5646. Default: en
    PlainTextBody string
    The text body
    Subject string
    The subject
    TemplateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    TenantId string
    The AppID instance GUID
    AppidCloudDirectoryTemplateId string
    HtmlBody string
    The HTML body
    Language string
    Select language for the template. Format as described at RFC5646. Default: en
    PlainTextBody string
    The text body
    subject String
    The subject
    templateName String
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId String
    The AppID instance GUID
    appidCloudDirectoryTemplateId String
    htmlBody String
    The HTML body
    language String
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody String
    The text body
    subject string
    The subject
    templateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId string
    The AppID instance GUID
    appidCloudDirectoryTemplateId string
    htmlBody string
    The HTML body
    language string
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody string
    The text body
    subject str
    The subject
    template_name str
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenant_id str
    The AppID instance GUID
    appid_cloud_directory_template_id str
    html_body str
    The HTML body
    language str
    Select language for the template. Format as described at RFC5646. Default: en
    plain_text_body str
    The text body
    subject String
    The subject
    templateName String
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId String
    The AppID instance GUID
    appidCloudDirectoryTemplateId String
    htmlBody String
    The HTML body
    language String
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody String
    The text body

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AppidCloudDirectoryTemplate resource produces the following output properties:

    Base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    Id string
    The provider-assigned unique ID for this managed resource.
    Base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    Id string
    The provider-assigned unique ID for this managed resource.
    base64EncodedHtmlBody String
    (String) The HTML body of the email encoded in Base64
    id String
    The provider-assigned unique ID for this managed resource.
    base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    id string
    The provider-assigned unique ID for this managed resource.
    base64_encoded_html_body str
    (String) The HTML body of the email encoded in Base64
    id str
    The provider-assigned unique ID for this managed resource.
    base64EncodedHtmlBody String
    (String) The HTML body of the email encoded in Base64
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AppidCloudDirectoryTemplate Resource

    Get an existing AppidCloudDirectoryTemplate 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?: AppidCloudDirectoryTemplateState, opts?: CustomResourceOptions): AppidCloudDirectoryTemplate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            appid_cloud_directory_template_id: Optional[str] = None,
            base64_encoded_html_body: Optional[str] = None,
            html_body: Optional[str] = None,
            language: Optional[str] = None,
            plain_text_body: Optional[str] = None,
            subject: Optional[str] = None,
            template_name: Optional[str] = None,
            tenant_id: Optional[str] = None) -> AppidCloudDirectoryTemplate
    func GetAppidCloudDirectoryTemplate(ctx *Context, name string, id IDInput, state *AppidCloudDirectoryTemplateState, opts ...ResourceOption) (*AppidCloudDirectoryTemplate, error)
    public static AppidCloudDirectoryTemplate Get(string name, Input<string> id, AppidCloudDirectoryTemplateState? state, CustomResourceOptions? opts = null)
    public static AppidCloudDirectoryTemplate get(String name, Output<String> id, AppidCloudDirectoryTemplateState state, CustomResourceOptions options)
    resources:  _:    type: ibm:AppidCloudDirectoryTemplate    get:      id: ${id}
    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.
    The following state arguments are supported:
    AppidCloudDirectoryTemplateId string
    Base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    HtmlBody string
    The HTML body
    Language string
    Select language for the template. Format as described at RFC5646. Default: en
    PlainTextBody string
    The text body
    Subject string
    The subject
    TemplateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    TenantId string
    The AppID instance GUID
    AppidCloudDirectoryTemplateId string
    Base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    HtmlBody string
    The HTML body
    Language string
    Select language for the template. Format as described at RFC5646. Default: en
    PlainTextBody string
    The text body
    Subject string
    The subject
    TemplateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    TenantId string
    The AppID instance GUID
    appidCloudDirectoryTemplateId String
    base64EncodedHtmlBody String
    (String) The HTML body of the email encoded in Base64
    htmlBody String
    The HTML body
    language String
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody String
    The text body
    subject String
    The subject
    templateName String
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId String
    The AppID instance GUID
    appidCloudDirectoryTemplateId string
    base64EncodedHtmlBody string
    (String) The HTML body of the email encoded in Base64
    htmlBody string
    The HTML body
    language string
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody string
    The text body
    subject string
    The subject
    templateName string
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId string
    The AppID instance GUID
    appid_cloud_directory_template_id str
    base64_encoded_html_body str
    (String) The HTML body of the email encoded in Base64
    html_body str
    The HTML body
    language str
    Select language for the template. Format as described at RFC5646. Default: en
    plain_text_body str
    The text body
    subject str
    The subject
    template_name str
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenant_id str
    The AppID instance GUID
    appidCloudDirectoryTemplateId String
    base64EncodedHtmlBody String
    (String) The HTML body of the email encoded in Base64
    htmlBody String
    The HTML body
    language String
    Select language for the template. Format as described at RFC5646. Default: en
    plainTextBody String
    The text body
    subject String
    The subject
    templateName String
    The type of email template. This can be USER_VERIFICATION, WELCOME, PASSWORD_CHANGED, RESET_PASSWORD or MFA_VERIFICATION
    tenantId String
    The AppID instance GUID

    Import

    The ibm_appid_cloud_directory_template resource can be imported by using the AppID tenant ID, template name and language.

    Syntax

    bash

    $ pulumi import ibm:index/appidCloudDirectoryTemplate:AppidCloudDirectoryTemplate tpl <tenant_id>/<template_name>/<language>
    

    Example

    bash

    $ pulumi import ibm:index/appidCloudDirectoryTemplate:AppidCloudDirectoryTemplate tpl 5fa344a8-d361-4bc2-9051-58ca253f4b2b/WELCOME/en
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud