templates_controls
Creates, updates, deletes, gets or lists a templates_controls resource.
Overview​
| Name | templates_controls |
| Type | Resource |
| Id | ovh.sms.templates_controls |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the template |
activity | string | Specify the kind of template (alerting, authentification, transactional) |
comment | string | Message sent by the moderator |
datetime | string (date-time) | Template creation datetime |
description | string | Template description |
message | string | Message pattern to be moderated. Use "#VALUE#" format for dynamic text area. |
status | string | Template status (disable, enable, refused, waitingValidation) |
Sms template for moderation (Needed to send in US country)
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the template |
activity | string | Specify the kind of template (alerting, authentification, transactional) |
comment | string | Message sent by the moderator |
datetime | string (date-time) | Template creation datetime |
description | string | Template description |
message | string | Message pattern to be moderated. Use "#VALUE#" format for dynamic text area. |
status | string | Template status (disable, enable, refused, waitingValidation) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | name, service_name | Get a message template. Returns the message template: pattern, activity, status and moderator comment. | |
list | select | service_name | x_pagination_mode | List message templates. Returns the message templates. Sending SMS to the United States requires a template validated by a moderator. |
create | insert | service_name, activity, message, name | Create a message template. Creates a message template and submits it to moderation. Sending SMS to the United States requires a validated template. | |
update | update | name, service_name | Update a message template. Updates the message template: description, message pattern with #VALUE# dynamic areas, and kind (alerting, authentification or transactional). | |
delete | delete | name, service_name | Delete a message template. Deletes the message template from the SMS account, whatever its moderation status. | |
relaunch_validation | exec | name, serviceName, description, message | Relaunch template validation. Submits the message template to moderation again after a refusal, with an updated message pattern and description. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
name | string | Name of the template |
serviceName | string | The internal name of your SMS offer |
service_name | string | The internal name of your SMS offer (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
Get a message template. Returns the message template: pattern, activity, status and moderator comment.
SELECT
name,
activity,
comment,
datetime,
description,
message,
status
FROM ovh.sms.templates_controls
WHERE name = '{{ name }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List message templates. Returns the message templates. Sending SMS to the United States requires a template validated by a moderator.
SELECT
name,
activity,
comment,
datetime,
description,
message,
status
FROM ovh.sms.templates_controls
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a message template. Creates a message template and submits it to moderation. Sending SMS to the United States requires a validated template.
INSERT INTO ovh.sms.templates_controls (
activity,
description,
message,
name,
reason,
service_name
)
SELECT
'{{ activity }}' /* required */,
'{{ description }}',
'{{ message }}' /* required */,
'{{ name }}' /* required */,
'{{ reason }}',
'{{ service_name }}'
;
# Description fields are for documentation purposes
- name: templates_controls
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the templates_controls resource.
- name: activity
value: "{{ activity }}"
description: |
Specify the kind of template
valid_values: ['alerting', 'authentification', 'transactional']
- name: description
value: "{{ description }}"
description: |
Template description
- name: message
value: "{{ message }}"
description: |
Message pattern to be moderated. Use "#VALUE#" format for dynamic text area.
- name: name
value: "{{ name }}"
description: |
Name of the template
- name: reason
value: "{{ reason }}"
description: |
Message seen by the moderator
UPDATE examples​
- update
Update a message template. Updates the message template: description, message pattern with #VALUE# dynamic areas, and kind (alerting, authentification or transactional).
UPDATE ovh.sms.templates_controls
SET
activity = '{{ activity }}',
description = '{{ description }}',
message = '{{ message }}',
name = '{{ name }}',
status = '{{ status }}'
WHERE
name = '{{ name }}' --required
AND service_name = '{{ service_name }}' --required;
DELETE examples​
- delete
Delete a message template. Deletes the message template from the SMS account, whatever its moderation status.
DELETE FROM ovh.sms.templates_controls
WHERE name = '{{ name }}' --required
AND service_name = '{{ service_name }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- relaunch_validation
Relaunch template validation. Submits the message template to moderation again after a refusal, with an updated message pattern and description.
EXEC ovh.sms.templates_controls.relaunch_validation
@name='{{ name }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"description": "{{ description }}",
"message": "{{ message }}"
}'
;