mailing_lists
Creates, updates, deletes, gets or lists a mailing_lists resource.
Overview​
| Name | mailing_lists |
| Type | Resource |
| Id | ovh.email_domain.mailing_lists |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of mailing list |
name | string | Name of mailing list |
language | string | Language of mailing list (de, en, es, fr, it, nl, pl, pt) |
nb_subscribers | integer | Subscribers number of mailing list (wire: nbSubscribers) |
nb_subscribers_update_date | string (date-time) | Last update subscribers (wire: nbSubscribersUpdateDate) |
options | object | Options of mailing list |
owner_email | string | Owner email of mailing list (wire: ownerEmail) |
reply_to | string | Email to reply of mailing list (wire: replyTo) |
Mailing List
| Name | Datatype | Description |
|---|---|---|
id | integer | Id of mailing list |
name | string | Name of mailing list |
language | string | Language of mailing list (de, en, es, fr, it, nl, pl, pt) |
nb_subscribers | integer | Subscribers number of mailing list (wire: nbSubscribers) |
nb_subscribers_update_date | string (date-time) | Last update subscribers (wire: nbSubscribersUpdateDate) |
options | object | Options of mailing list |
owner_email | string | Owner email of mailing list (wire: ownerEmail) |
reply_to | string | Email to reply of mailing list (wire: replyTo) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | domain, name | Get a mailing list. Returns the owner email, reply-to address, language, moderation options and number of subscribers of the mailing list. | |
list | select | domain | name, x_pagination_mode | List mailing lists. Returns the names of the mailing lists of the domain. Filter them by name to look for a given list. |
create | insert | domain, language, name, options, owner_email | Create a mailing list. Creates a mailing list with a name, an owner email, a language and moderation options, and returns the task. | |
update | update | domain, name | Update a mailing list. Updates the owner email, the reply-to address or the language of the mailing list. | |
delete | delete | domain, name | Delete a mailing list. Deletes the mailing list of the domain with its subscribers and moderators, and returns the task. | |
change_options | exec | domain, name, options | Change mailing list options. Sets message moderation (moderatorMessage), subscription moderation (subscribeByModerator) and usersPostOnly, which lets only moderators post, and returns the task. | |
send_list_by_email | exec | domain, name, email | Send 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.
| 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"}}) |
domain | string | Name of your domain name |
name | string | Name of mailing list |
name | string | Mailing list name |
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 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
;
List mailing lists. Returns the names of the mailing lists of the domain. Filter them by name to look for a given 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 }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: mailing_lists
props:
- name: domain
value: "{{ domain }}"
description: Required parameter for the mailing_lists resource.
- name: language
value: "{{ language }}"
description: |
Language of mailing list
valid_values: ['de', 'en', 'es', 'fr', 'it', 'nl', 'pl', 'pt']
- name: name
value: "{{ name }}"
description: |
Mailing list name
- name: options
description: |
Options of mailing list
value:
moderatorMessage: {{ moderatorMessage }}
subscribeByModerator: {{ subscribeByModerator }}
usersPostOnly: {{ usersPostOnly }}
- name: owner_email
value: "{{ owner_email }}"
description: |
Owner Email
- name: reply_to
value: "{{ reply_to }}"
description: |
Email to reply of mailing list
UPDATE examples​
- update
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
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_options
- send_list_by_email
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 }}"
}'
;
Send member lists by email. Sends the lists of moderators and subscribers of the mailing list to the email address, and returns the task.
EXEC ovh.email_domain.mailing_lists.send_list_by_email
@domain='{{ domain }}' --required,
@name='{{ name }}' --required
@@json=
'{
"email": "{{ email }}"
}'
;