- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
  - _new_existing
  - _new
  - is_valid
  - _is_valid
  - name
  - id
  - domain
  - properties
  - language
  - options
  - owner_email
  - reply_to
  - nb_subscribers_update_date
  - nb_subscribers
  - change
  - delete
  - change_options
  - moderators
  - moderators
  - add_moderator
  - delete_moderator
  - delete_moderator
  - subscribers
  - subscriber
  - add_subscriber
  - delete_subscriber

# NAME

Webservice::OVH::Email::Domain::Domain::MailingList

# SYNOPSIS

use Webservice::OVH;

my $ovh = Webservice::OVH->new_from_json("credentials.json");

my $email_domain = $ovh->email->domain->domain('testdomain.de');

my $mailing_list = $email_domain->new_redirection(language 'de', name => 'infos', options => {moderatorMessage => 'true', subscribeByModerator => 'true', usersPostOnly => 'false'}, owner_email => 'owner@test.de' );

# DESCRIPTION

Provides ability to create, delete, change and manage mailinglists.

# METHODS

## _new_existing

Internal Method to create a MailingList object. This method should never be called directly.

- Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $domain - parent domain Objekt, $mailing_list_name => unique name

- Return: Webservice::OVH::Email::Domain::Domain::MailingList

- Synopsis: Webservice::OVH::Email::Domain::Domain::MailingList->_new_existing($ovh_api_wrapper, $domain, $mailing_list_name, $module);

## _new

Internal Method to create the MailingList object. This method should never be called directly.

- Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $domain - parent domain, %params - key => value

- Return: Webservice::OVH::Email::Domain::Domain::MailingList

- Synopsis: Webservice::OVH::Email::Domain::Domain::MailingList->_new($ovh_api_wrapper, $domain, $module, language 'DE', name => 'infos', options => {}, owner_email => 'owner@test.de', reply_to => 'test@test.de' );

## is_valid

When this mailinglist is deleted on the api side, this method returns 0.

- Return: VALUE

- Synopsis: print "Valid" if $mailing_list->is_valid;

## _is_valid

Intern method to check validity. Difference is that this method carps an error.

- Return: VALUE

- Synopsis: $mailing_list->_is_valid;

## name

Unique identifier.

- Return: VALUE

- Synopsis: my $name = $redirection->name;

## id

Secondary unique identifier.

- Return: VALUE

- Synopsis: my $id = $mailing_list->id;

## domain

Returns the email-domain this redirection is attached to.

- Return: Webservice::Email::Domain::Domain

- Synopsis: my $email_domain = $mailing_list->domain;

## properties

Returns the raw properties as a hash. This is the original return value of the web-api.

- Return: HASH

- Synopsis: my $properties = $mailing_list->properties;

## language

Exposed property value.

- Return: VALUE

- Synopsis: my $language = $mailing_list->language;

## options

Exposed property value.

- Return: HASH

- Synopsis: my $options = $mailing_list->options;

## owner_email

Exposed property value.

- Return: VALUE

- Synopsis: my $owner_email = $mailing_list->owner_email;

## reply_to

Exposed property value.

- Return: VALUE

- Synopsis: my $reply_to = $mailing_list->reply_to;

## nb_subscribers_update_date

Exposed property value.

- Return: VALUE

- Synopsis: my $nb_subscribers_update_date = $mailing_list->nb_subscribers_update_date;

## nb_subscribers

Exposed property value.

- Return: VALUE

- Synopsis: my $nb_subscribers = $mailing_list->nb_subscribers;

## change

Changes the objcet.

- Parameter: %params - key => value language owner_email reply_to

- Synopsis: $mailing_list->change( language => 'en', owner_email => 'other@test.de', reply_to => 'reply@test.de');

## delete

Deletes the mailinglist api sided and sets this object invalid.

- Synopsis: $mailing_list->delete;

## change_options

Changes additional options.

- Parameter: %params - key => value moderator_message subscribe_by_moderator users_post_only

- Synopsis: $mailing_list->change_options( moderator_message => 'false', subscribe_by_moderator => 'false', users_post_only => 'true' );

## moderators

Returns an array of all moderators of this mailinglist.

- Return: ARRAY

- Synopsis: my $moderators = $mailing_list->moderators();

## moderators

Returns properties for a specified moderator E-Mail

- Parameter: $email - email address

- Return: HASH

- Synopsis: my $properties = $mailing_list->moderator('moderator@test.de');

## add_moderator

Adds a moderator via E-Mail address.

- Parameter: $email - email address

- Synopsis: my $properties = $mailing_list->add_moderator('moderator@test.de');

## delete_moderator

Deletes a moderator via E-Mail address.

- Parameter: $email - email address

- Synopsis: my $properties = $mailing_list->delete_moderator('moderator@test.de');

## delete_moderator

Sends the subscriber and moderator list to a specified E-Mail address.

- Parameter: $email - email address

- Synopsis: my $properties = $mailing_list->send_list_by_email('moderator@test.de');

## subscribers

Returns an array of all subscribers or a filtered list.

- $email - filter for specified E-Mail address

- Return: ARRAY

- Synopsis: my $subscribers = $mailing_list->subscribers();

## subscriber

Returns the properties of a single subscriber.

- Parameter: $email - E-Mail address

- Return: HASH

- Synopsis: my $subscriber = $mailing_list->subscriber('sub@test.de');

## add_subscriber

Adds an subscriber to the mailinglist.

- Parameter: $email - E-Mail address

- Synopsis: $mailing_list->add_subscriber('sub@test.de');

## delete_subscriber

Deletes an subscriber to the mailinglist.

- Parameter: $email - E-Mail address

- Synopsis: $mailing_list->delete_subscriber('sub@test.de');