ibm.EnEmailTemplate
Explore with Pulumi AI
Create, update, or delete Email Template by using IBM Cloud™ Event Notifications.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const emailTemplate = new ibm.EnEmailTemplate("emailTemplate", {
instanceGuid: ibm_resource_instance.en_terraform_test_resource.guid,
type: "smtp_custom.notification",
description: "Destination Custom Email for event notification",
params: {
body: "<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>",
subject: "HI This is the template subject for the invitation",
},
});
import pulumi
import pulumi_ibm as ibm
email_template = ibm.EnEmailTemplate("emailTemplate",
instance_guid=ibm_resource_instance["en_terraform_test_resource"]["guid"],
type="smtp_custom.notification",
description="Destination Custom Email for event notification",
params={
"body": "<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>",
"subject": "HI This is the template subject for the invitation",
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewEnEmailTemplate(ctx, "emailTemplate", &ibm.EnEmailTemplateArgs{
InstanceGuid: pulumi.Any(ibm_resource_instance.En_terraform_test_resource.Guid),
Type: pulumi.String("smtp_custom.notification"),
Description: pulumi.String("Destination Custom Email for event notification"),
Params: &ibm.EnEmailTemplateParamsArgs{
Body: pulumi.String("<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>"),
Subject: pulumi.String("HI This is the template subject for the invitation"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var emailTemplate = new Ibm.EnEmailTemplate("emailTemplate", new()
{
InstanceGuid = ibm_resource_instance.En_terraform_test_resource.Guid,
Type = "smtp_custom.notification",
Description = "Destination Custom Email for event notification",
Params = new Ibm.Inputs.EnEmailTemplateParamsArgs
{
Body = "<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>",
Subject = "HI This is the template subject for the invitation",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.EnEmailTemplate;
import com.pulumi.ibm.EnEmailTemplateArgs;
import com.pulumi.ibm.inputs.EnEmailTemplateParamsArgs;
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 emailTemplate = new EnEmailTemplate("emailTemplate", EnEmailTemplateArgs.builder()
.instanceGuid(ibm_resource_instance.en_terraform_test_resource().guid())
.type("smtp_custom.notification")
.description("Destination Custom Email for event notification")
.params(EnEmailTemplateParamsArgs.builder()
.body("<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>")
.subject("HI This is the template subject for the invitation")
.build())
.build());
}
}
resources:
emailTemplate:
type: ibm:EnEmailTemplate
properties:
instanceGuid: ${ibm_resource_instance.en_terraform_test_resource.guid}
type: smtp_custom.notification
description: Destination Custom Email for event notification
params:
body: '<!DOCTYPE html><html><head><title>Go To-Do list</title></head><body><p>To-Do list for user: {{ Data.issuer.p }}</p><table><tr><td>Task</td><td>Done</td></tr>{{#each Email}}<tr><td>{{ this }}</td></tr>{{/each}}</table></body></html>'
subject: HI This is the template subject for the invitation
Create EnEmailTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EnEmailTemplate(name: string, args: EnEmailTemplateArgs, opts?: CustomResourceOptions);
@overload
def EnEmailTemplate(resource_name: str,
args: EnEmailTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EnEmailTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_guid: Optional[str] = None,
type: Optional[str] = None,
description: Optional[str] = None,
en_email_template_id: Optional[str] = None,
name: Optional[str] = None,
params: Optional[EnEmailTemplateParamsArgs] = None)
func NewEnEmailTemplate(ctx *Context, name string, args EnEmailTemplateArgs, opts ...ResourceOption) (*EnEmailTemplate, error)
public EnEmailTemplate(string name, EnEmailTemplateArgs args, CustomResourceOptions? opts = null)
public EnEmailTemplate(String name, EnEmailTemplateArgs args)
public EnEmailTemplate(String name, EnEmailTemplateArgs args, CustomResourceOptions options)
type: ibm:EnEmailTemplate
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 EnEmailTemplateArgs
- 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 EnEmailTemplateArgs
- 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 EnEmailTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnEmailTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnEmailTemplateArgs
- 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 enEmailTemplateResource = new Ibm.EnEmailTemplate("enEmailTemplateResource", new()
{
InstanceGuid = "string",
Type = "string",
Description = "string",
EnEmailTemplateId = "string",
Name = "string",
Params = new Ibm.Inputs.EnEmailTemplateParamsArgs
{
Body = "string",
Subject = "string",
},
});
example, err := ibm.NewEnEmailTemplate(ctx, "enEmailTemplateResource", &ibm.EnEmailTemplateArgs{
InstanceGuid: pulumi.String("string"),
Type: pulumi.String("string"),
Description: pulumi.String("string"),
EnEmailTemplateId: pulumi.String("string"),
Name: pulumi.String("string"),
Params: &ibm.EnEmailTemplateParamsArgs{
Body: pulumi.String("string"),
Subject: pulumi.String("string"),
},
})
var enEmailTemplateResource = new EnEmailTemplate("enEmailTemplateResource", EnEmailTemplateArgs.builder()
.instanceGuid("string")
.type("string")
.description("string")
.enEmailTemplateId("string")
.name("string")
.params(EnEmailTemplateParamsArgs.builder()
.body("string")
.subject("string")
.build())
.build());
en_email_template_resource = ibm.EnEmailTemplate("enEmailTemplateResource",
instance_guid="string",
type="string",
description="string",
en_email_template_id="string",
name="string",
params={
"body": "string",
"subject": "string",
})
const enEmailTemplateResource = new ibm.EnEmailTemplate("enEmailTemplateResource", {
instanceGuid: "string",
type: "string",
description: "string",
enEmailTemplateId: "string",
name: "string",
params: {
body: "string",
subject: "string",
},
});
type: ibm:EnEmailTemplate
properties:
description: string
enEmailTemplateId: string
instanceGuid: string
name: string
params:
body: string
subject: string
type: string
EnEmailTemplate 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 EnEmailTemplate resource accepts the following input properties:
- Instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- Type string
- smtp_custom.notification/smtp_custom.invitation.
- Description string
- The Template description.
- En
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - Name string
- The Message Template.
- Params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- Instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- Type string
- smtp_custom.notification/smtp_custom.invitation.
- Description string
- The Template description.
- En
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - Name string
- The Message Template.
- Params
En
Email Template Params Args Payload describing a template configuration
Nested scheme for params:
- instance
Guid String - Unique identifier for IBM Cloud Event Notifications instance.
- type String
- smtp_custom.notification/smtp_custom.invitation.
- description String
- The Template description.
- en
Email StringTemplate Id - (String) The unique identifier of the
email_template
. - name String
- The Message Template.
- params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- type string
- smtp_custom.notification/smtp_custom.invitation.
- description string
- The Template description.
- en
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - name string
- The Message Template.
- params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- instance_
guid str - Unique identifier for IBM Cloud Event Notifications instance.
- type str
- smtp_custom.notification/smtp_custom.invitation.
- description str
- The Template description.
- en_
email_ strtemplate_ id - (String) The unique identifier of the
email_template
. - name str
- The Message Template.
- params
En
Email Template Params Args Payload describing a template configuration
Nested scheme for params:
- instance
Guid String - Unique identifier for IBM Cloud Event Notifications instance.
- type String
- smtp_custom.notification/smtp_custom.invitation.
- description String
- The Template description.
- en
Email StringTemplate Id - (String) The unique identifier of the
email_template
. - name String
- The Message Template.
- params Property Map
Payload describing a template configuration
Nested scheme for params:
Outputs
All input properties are implicitly available as output properties. Additionally, the EnEmailTemplate resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Subscription
Count double - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- Subscription
Names List<string> - (List) List of subscriptions.
- Template
Id string - (String) The unique identifier of the created Template.
- Updated
At string - (String) Last updated time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Subscription
Count float64 - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- Subscription
Names []string - (List) List of subscriptions.
- Template
Id string - (String) The unique identifier of the created Template.
- Updated
At string - (String) Last updated time.
- id String
- The provider-assigned unique ID for this managed resource.
- subscription
Count Double - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names List<String> - (List) List of subscriptions.
- template
Id String - (String) The unique identifier of the created Template.
- updated
At String - (String) Last updated time.
- id string
- The provider-assigned unique ID for this managed resource.
- subscription
Count number - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names string[] - (List) List of subscriptions.
- template
Id string - (String) The unique identifier of the created Template.
- updated
At string - (String) Last updated time.
- id str
- The provider-assigned unique ID for this managed resource.
- subscription_
count float - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription_
names Sequence[str] - (List) List of subscriptions.
- template_
id str - (String) The unique identifier of the created Template.
- updated_
at str - (String) Last updated time.
- id String
- The provider-assigned unique ID for this managed resource.
- subscription
Count Number - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names List<String> - (List) List of subscriptions.
- template
Id String - (String) The unique identifier of the created Template.
- updated
At String - (String) Last updated time.
Look up Existing EnEmailTemplate Resource
Get an existing EnEmailTemplate 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?: EnEmailTemplateState, opts?: CustomResourceOptions): EnEmailTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
en_email_template_id: Optional[str] = None,
instance_guid: Optional[str] = None,
name: Optional[str] = None,
params: Optional[EnEmailTemplateParamsArgs] = None,
subscription_count: Optional[float] = None,
subscription_names: Optional[Sequence[str]] = None,
template_id: Optional[str] = None,
type: Optional[str] = None,
updated_at: Optional[str] = None) -> EnEmailTemplate
func GetEnEmailTemplate(ctx *Context, name string, id IDInput, state *EnEmailTemplateState, opts ...ResourceOption) (*EnEmailTemplate, error)
public static EnEmailTemplate Get(string name, Input<string> id, EnEmailTemplateState? state, CustomResourceOptions? opts = null)
public static EnEmailTemplate get(String name, Output<String> id, EnEmailTemplateState state, CustomResourceOptions options)
resources: _: type: ibm:EnEmailTemplate 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.
- Description string
- The Template description.
- En
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - Instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- Name string
- The Message Template.
- Params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- Subscription
Count double - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- Subscription
Names List<string> - (List) List of subscriptions.
- Template
Id string - (String) The unique identifier of the created Template.
- Type string
- smtp_custom.notification/smtp_custom.invitation.
- Updated
At string - (String) Last updated time.
- Description string
- The Template description.
- En
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - Instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- Name string
- The Message Template.
- Params
En
Email Template Params Args Payload describing a template configuration
Nested scheme for params:
- Subscription
Count float64 - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- Subscription
Names []string - (List) List of subscriptions.
- Template
Id string - (String) The unique identifier of the created Template.
- Type string
- smtp_custom.notification/smtp_custom.invitation.
- Updated
At string - (String) Last updated time.
- description String
- The Template description.
- en
Email StringTemplate Id - (String) The unique identifier of the
email_template
. - instance
Guid String - Unique identifier for IBM Cloud Event Notifications instance.
- name String
- The Message Template.
- params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- subscription
Count Double - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names List<String> - (List) List of subscriptions.
- template
Id String - (String) The unique identifier of the created Template.
- type String
- smtp_custom.notification/smtp_custom.invitation.
- updated
At String - (String) Last updated time.
- description string
- The Template description.
- en
Email stringTemplate Id - (String) The unique identifier of the
email_template
. - instance
Guid string - Unique identifier for IBM Cloud Event Notifications instance.
- name string
- The Message Template.
- params
En
Email Template Params Payload describing a template configuration
Nested scheme for params:
- subscription
Count number - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names string[] - (List) List of subscriptions.
- template
Id string - (String) The unique identifier of the created Template.
- type string
- smtp_custom.notification/smtp_custom.invitation.
- updated
At string - (String) Last updated time.
- description str
- The Template description.
- en_
email_ strtemplate_ id - (String) The unique identifier of the
email_template
. - instance_
guid str - Unique identifier for IBM Cloud Event Notifications instance.
- name str
- The Message Template.
- params
En
Email Template Params Args Payload describing a template configuration
Nested scheme for params:
- subscription_
count float - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription_
names Sequence[str] - (List) List of subscriptions.
- template_
id str - (String) The unique identifier of the created Template.
- type str
- smtp_custom.notification/smtp_custom.invitation.
- updated_
at str - (String) Last updated time.
- description String
- The Template description.
- en
Email StringTemplate Id - (String) The unique identifier of the
email_template
. - instance
Guid String - Unique identifier for IBM Cloud Event Notifications instance.
- name String
- The Message Template.
- params Property Map
Payload describing a template configuration
Nested scheme for params:
- subscription
Count Number - (Integer) Number of subscriptions.
- Constraints: The minimum value is
0
.
- Constraints: The minimum value is
- subscription
Names List<String> - (List) List of subscriptions.
- template
Id String - (String) The unique identifier of the created Template.
- type String
- smtp_custom.notification/smtp_custom.invitation.
- updated
At String - (String) Last updated time.
Supporting Types
EnEmailTemplateParams, EnEmailTemplateParamsArgs
Import
You can import the ibm_en_email_template
resource by using id
.
The id
property can be formed from instance_guid
, and template_id
in the following format:
<instance_guid>/<template_id>
instance_guid
: A string. Unique identifier for IBM Cloud Event Notifications instance.template_id
: A string. Unique identifier for Template.
Example
$ pulumi import ibm:index/enEmailTemplate:EnEmailTemplate email_template <instance_guid>/<template_id>
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.