Skip to content

/AWS1/CL_PPT=>UPDATEEMAILTEMPLATE()

About UpdateEmailTemplate

Updates an existing message template for messages that are sent through the email channel.

Method Signature

IMPORTING

Required arguments:

io_emailtemplaterequest TYPE REF TO /AWS1/CL_PPTEMAILTMPLREQUEST /AWS1/CL_PPTEMAILTMPLREQUEST

EmailTemplateRequest

iv_templatename TYPE /AWS1/PPT__STRING /AWS1/PPT__STRING

The 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.

Optional arguments:

iv_createnewversion TYPE /AWS1/PPT__BOOLEAN /AWS1/PPT__BOOLEAN

Specifies whether to save the updates as a new version of the message template. Valid values are: true, save the updates as a new version; and, false, save the updates to (overwrite) the latest existing version of the template.

If you don't specify a value for this parameter, Amazon Pinpoint saves the updates to (overwrites) the latest existing version of the template. If you specify a value of true for this parameter, don't specify a value for the version parameter. Otherwise, an error will occur.

iv_version TYPE /AWS1/PPT__STRING /AWS1/PPT__STRING

The unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the Template Versions resource.

If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur.

If you don't specify a value for this parameter, Amazon Pinpoint does the following:

  • For a get operation, retrieves information about the active version of the template.

  • For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false.

  • For a delete operation, deletes the template, including all versions of the template.

RETURNING

oo_output TYPE REF TO /aws1/cl_pptupdateemailtmplrsp /AWS1/CL_PPTUPDATEEMAILTMPLRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_ppt~updateemailtemplate(
  io_emailtemplaterequest = new /aws1/cl_pptemailtmplrequest(
    it_headers = VALUE /aws1/cl_pptmessageheader=>tt_listofmessageheader(
      (
        new /aws1/cl_pptmessageheader(
          iv_name = |string|
          iv_value = |string|
        )
      )
    )
    it_tags = VALUE /aws1/cl_pptmapof__string_w=>tt_mapof__string(
      (
        VALUE /aws1/cl_pptmapof__string_w=>ts_mapof__string_maprow(
          key = |string|
          value = new /aws1/cl_pptmapof__string_w( |string| )
        )
      )
    )
    iv_defaultsubstitutions = |string|
    iv_htmlpart = |string|
    iv_recommenderid = |string|
    iv_subject = |string|
    iv_templatedescription = |string|
    iv_textpart = |string|
  )
  iv_createnewversion = ABAP_TRUE
  iv_templatename = |string|
  iv_version = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_messagebody = lo_result->get_messagebody( ).
  IF lo_messagebody IS NOT INITIAL.
    lv___string = lo_messagebody->get_message( ).
    lv___string = lo_messagebody->get_requestid( ).
  ENDIF.
ENDIF.