Skip to main content

emails

Creates, updates, deletes, gets or lists an emails resource.

Overview​

Nameemails
TypeResource
Idovh.hosting_web.emails

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
bounceintegerBounce
emailstringEmail used to receive errors
max_per_dayintegerMax email to sent per day (wire: maxPerDay)
sentintegerEmail sent since hosting creation
sent_todayintegerEmail sent today (wire: sentToday)
spoofingintegerSpoofing Bounce
statestringEmail state (bounce, force, ko, ok, purging, spam)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameGet the email state. Returns the state of the emails sent by the hosting scripts, with the volumes sent, the bounces and the daily limit.
updateupdateservice_nameUpdate the email settings. Updates the email address that receives the sending errors of the hosting scripts. The other fields are read-only.
requestexecserviceName, actionRun 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.

NameDatatypeDescription
api_hoststringThe 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"}})
serviceNamestringThe internal name of your hosting
service_namestringThe internal name of your hosting (wire: serviceName)

SELECT examples​

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 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.

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 }}"
}'
;