Skip to main content

mailing_lists

Creates, updates, deletes, gets or lists a mailing_lists resource.

Overview​

Namemailing_lists
TypeResource
Idovh.email_domain.mailing_lists

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerId of mailing list
namestringName of mailing list
languagestringLanguage of mailing list (de, en, es, fr, it, nl, pl, pt)
nb_subscribersintegerSubscribers number of mailing list (wire: nbSubscribers)
nb_subscribers_update_datestring (date-time)Last update subscribers (wire: nbSubscribersUpdateDate)
optionsobjectOptions of mailing list
owner_emailstringOwner email of mailing list (wire: ownerEmail)
reply_tostringEmail to reply of mailing list (wire: replyTo)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdomain, nameGet a mailing list. Returns the owner email, reply-to address, language, moderation options and number of subscribers of the mailing list.
listselectdomainname, x_pagination_modeList mailing lists. Returns the names of the mailing lists of the domain. Filter them by name to look for a given list.
createinsertdomain, language, name, options, owner_emailCreate a mailing list. Creates a mailing list with a name, an owner email, a language and moderation options, and returns the task.
updateupdatedomain, nameUpdate a mailing list. Updates the owner email, the reply-to address or the language of the mailing list.
deletedeletedomain, nameDelete a mailing list. Deletes the mailing list of the domain with its subscribers and moderators, and returns the task.
change_optionsexecdomain, name, optionsChange mailing list options. Sets message moderation (moderatorMessage), subscription moderation (subscribeByModerator) and usersPostOnly, which lets only moderators post, and returns the task.
send_list_by_emailexecdomain, name, emailSend member lists by email. Sends the lists of moderators and subscribers of the mailing list to the email address, and returns the task.

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"}})
domainstringName of your domain name
namestringName of mailing list
namestringMailing list name
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a mailing list. Returns the owner email, reply-to address, language, moderation options and number of subscribers of the mailing list.

SELECT
id,
name,
language,
nb_subscribers,
nb_subscribers_update_date,
options,
owner_email,
reply_to
FROM ovh.email_domain.mailing_lists
WHERE domain = '{{ domain }}' -- required
AND name = '{{ name }}' -- required
;

INSERT examples​

Create a mailing list. Creates a mailing list with a name, an owner email, a language and moderation options, and returns the task.

INSERT INTO ovh.email_domain.mailing_lists (
language,
name,
options,
owner_email,
reply_to,
domain
)
SELECT
'{{ language }}' /* required */,
'{{ name }}' /* required */,
'{{ options }}' /* required */,
'{{ owner_email }}' /* required */,
'{{ reply_to }}',
'{{ domain }}'
RETURNING
id,
account,
action,
date,
domain,
language
;

UPDATE examples​

Update a mailing list. Updates the owner email, the reply-to address or the language of the mailing list.

UPDATE ovh.email_domain.mailing_lists
SET
language = '{{ language }}',
owner_email = '{{ owner_email }}',
reply_to = '{{ reply_to }}'
WHERE
domain = '{{ domain }}' --required
AND name = '{{ name }}' --required;

DELETE examples​

Delete a mailing list. Deletes the mailing list of the domain with its subscribers and moderators, and returns the task.

DELETE FROM ovh.email_domain.mailing_lists
WHERE domain = '{{ domain }}' --required
AND name = '{{ name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Change mailing list options. Sets message moderation (moderatorMessage), subscription moderation (subscribeByModerator) and usersPostOnly, which lets only moderators post, and returns the task.

EXEC ovh.email_domain.mailing_lists.change_options
@domain='{{ domain }}' --required,
@name='{{ name }}' --required
@@json=
'{
"options": "{{ options }}"
}'
;