Modifier un template
Put /settings/templates/{id}
Paramètres dans l'URL :
| Nom | Description | Type | Obligatoire |
|---|---|---|---|
| id | Id du template | String | Oui |
Paramètres :
| Nom | Description | Type | Obligatoire | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Description du template | String | Oui | ||||||||||||
| from |
|
Struct | Oui | ||||||||||||
| htmlContent | Contenu Html | String | Oui | ||||||||||||
| textContent | Contenu texte | String | Oui |
Réponse :
| Nom | Description | Type |
|---|---|---|
| status | success / failure | String |
Langage de programmation :
Exemple de requête :
{
"description": "description du template",
"from": {
"address": "from@example.com",
"personalName": "Sender name"
},
"subject": "Message subject",
"htmlContent": "html content",
"textContent": "text content"
}
Exemple de réponse :
{
"status": "success"
}
Exemple de code :
curl -X PUT -d '{"description":"description du template","from":{"address":"from@example.com","personalName":"Sender name"},"subject":"Message subject","htmlContent":"html content","textContent":"text content"}' -H "Content-Type: application/json" -H "X-Tipimail-ApiUser:YOUR_SMTP_USERNAME" -H "X-Tipimail-ApiKey:YOUR_SMTP_KEY" https://api.tipimail.com/v1/settings/templates/g65r4g64h65tr47h678th11d
require 'vendor/autoload.php';
$tipimail = new Tipimail\Tipimail('YOUR_SMTP_USERNAME', 'YOUR_API_KEY');
try {
$id = '646r54g6r4gr6g46g46546d4';
$description = 'Description';
$fromAddress = 'from@example.com';
$fromPersonalName = 'From Personal Name';
$subject = 'Subject';
$htmlContent = 'html content';
$textContent = 'text content';
$tipimail->getSettingsService()->getTemplatesService()->update($id, $description, $fromAddress, $fromPersonalName, $subject, $htmlContent, $textContent);
}
catch(Tipimail\Exceptions\TipimailException $e) {
echo 'Exception received :', $e->getMessage(), "\n";
}