API Module Email Templates createEmailTemplateRequest

From Openprovider API documentation

Jump to: navigation, search

Contents

Module Email Templates > Create

Module Email Templates
Command name createEmailTemplateRequest
Use Create email template with the provided attributes

Note: It is much more convenient to modify e-mail template for reseller control panel

Input
Output
  • id (id of the email template)

Examples

Using PHP class

$request = new OP_Request; 
$request->setCommand('createEmailTemplateRequest')
   ->setAuth(array('username' => 'username', 'password' => 'password'))
   ->setArgs([
       'name' => 'Demo template',
       'group' => 'ive',
       'isDefault' => true,
       'isActive' => true,
       'locale' => ['nl_NL'],
       'fields' => [
           [
               'name' => 'senderEmail',
               'value' => 'myemail@mycompany.eu',
           ],
           [
               'name' => 'confirmUrl',
               'value' => 'http://icann-verification.registrar.eu/?email=%%email%%&authCode=%%authCode%%',
           ],
           [
               'name' => 'resellerName',
               'value' => 'demo Co',
           ],
           [
               'name' => 'subject',
               'value' => 'Initial E-mail verification',
           ],
           [
               'name' => 'body',
               'value' => '%%confirmUrl%% and %%respondDate%%',
           ],
           [
               'name' => 'reminderSubject',
               'value' => 'Email verification reminder',
           ],
           [
               'name' => 'reminderBody',
               'value' => '%%confirmUrl%% and %%respondDate%%',
           ],
       ],
   ]);

Raw XML

Please note that newlines and leading spaces are added only for readability. Those whitespaces should be excluded from your XML command before sending it to Openprovider.

<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <credentials>
    <username>username</username>
    <password>password</password>
  </credentials>
  <createEmailTemplateRequest>
    <name>Demo template</name>
    <group>ive</group>
    <isDefault>0</isDefault>
    <isActive>0</isActive>
    <locale>
      <array>
        <item>en_US</item>
      </array>
    </locale>
    <fields>
      <array>
        <item>
          <name>senderEmail</name>
          <value>do-not-reply@registrar.eu</value>
        </item>
        <item>
          <name>confirmUrl</name>
          <value>http://icann-verification.registrar.eu/?email=%%email%%&authCode=%%authCode%%</value>
        </item>
        <item>
          <name>resellerName</name>
          <value>demo Co</value>
        </item>
        <item>
          <name>subject</name>
          <value>My subject Email verification</value>
        </item>
        <item>
          <name>body</name>
          <value>%%confirmUrl%% and %%respondDate%%</value>
        </item>
        <item>
          <name>reminderSubject</name>
          <value>My Email verification reminder</value>
        </item>
        <item>
          <name>reminderBody</name>
          <value>%%confirmUrl%% and %%respondDate%%</value>
        </item>
      </array>
    </fields>
 </createEmailTemplateRequest>
</openXML>
<?xml version="1.0" encoding="UTF-8"?>
<openXML>
  <reply>
    <code>0</code>
    <desc></desc>
    <data><id>1404</id></data>
  </reply>
</openXML>
Views
Personal tools