API Module Email Templates createEmailTemplateRequest
From Openprovider API documentation
(Difference between revisions)
(Created page with '==Module Email Templates > Create== {| border="1" cellpadding="4" |- style="background-color:#BBBBBB;" |'''Module''' |Email Templates |- style="background-color:#EEEEEE;" |'''Com…') |
|||
Line 13: | Line 13: | ||
|'''Input''' | |'''Input''' | ||
| | | | ||
- | |||
*name | *name | ||
*group | *group | ||
- | * | + | *isDefault |
- | * | + | *isActive |
+ | *locale | ||
+ | *fields | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|'''Output''' | |'''Output''' | ||
Line 26: | Line 27: | ||
==Examples== | ==Examples== | ||
===Using PHP class=== | ===Using PHP class=== | ||
- | $request = new OP_Request; | + | $request = new OP_Request; |
- | $request->setCommand(' | + | $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' => '<h1>%%confirmUrl%% and %%respondDate%%</h1>', | ||
+ | ], | ||
+ | [ | ||
+ | 'name' => 'reminderSubject', | ||
+ | 'value' => 'Email verification reminder', | ||
+ | ], | ||
+ | [ | ||
+ | 'name' => 'reminderBody', | ||
+ | 'value' => '<h1>%%confirmUrl%% and %%respondDate%% </h1>', | ||
+ | ], | ||
+ | ], | ||
+ | ]); | ||
===Raw XML=== | ===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.'' | ''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.'' | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- |
Revision as of 12:31, 17 September 2015
Contents |
Module Email Templates > Create
Module | Email Templates |
Command name | createEmailTemplateRequest |
Use | Creates an email template with the provided data |
Input |
|
Output |
|
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.