emails
Creates, updates, deletes, gets or lists an emails resource.
Overview​
| Name | emails |
| Type | Resource |
| Id | ovh.hosting_web.emails |
Fields​
The following fields are returned by SELECT queries:
- get
successful operation
| Name | Datatype | Description |
|---|---|---|
bounce | integer | Bounce |
email | string | Email used to receive errors |
max_per_day | integer | Max email to sent per day (wire: maxPerDay) |
sent | integer | Email sent since hosting creation |
sent_today | integer | Email sent today (wire: sentToday) |
spoofing | integer | Spoofing Bounce |
state | string | Email state (bounce, force, ko, ok, purging, spam) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | Get the email state. Returns the state of the emails sent by the hosting scripts, with the volumes sent, the bounces and the daily limit. | |
update | update | service_name | Update the email settings. Updates the email address that receives the sending errors of the hosting scripts. The other fields are read-only. | |
request | exec | serviceName, action | Run an email action. Blocks or unblocks the emails sent by the hosting scripts, or purges the queue of emails waiting to be sent. |
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"}}) |
serviceName | string | The internal name of your hosting |
service_name | string | The internal name of your hosting (wire: serviceName) |
SELECT examples​
- get
Get the email state. Returns the state of the emails sent by the hosting scripts, with the volumes sent, the bounces and the daily limit.
SELECT
bounce,
email,
max_per_day,
sent,
sent_today,
spoofing,
state
FROM ovh.hosting_web.emails
WHERE service_name = '{{ service_name }}' -- required
;
UPDATE examples​
- update
Update the email settings. Updates the email address that receives the sending errors of the hosting scripts. The other fields are read-only.
UPDATE ovh.hosting_web.emails
SET
email = '{{ email }}'
WHERE
service_name = '{{ service_name }}' --required;
Lifecycle Methods​
EXEC variables use wire (API) names.
- request
Run an email action. Blocks or unblocks the emails sent by the hosting scripts, or purges the queue of emails waiting to be sent.
EXEC ovh.hosting_web.emails.request
@serviceName='{{ serviceName }}' --required
@@json=
'{
"action": "{{ action }}"
}'
;