struct Mailjet::Listrecipient

Overview

A list recipient object manages the relationship between a contact and a contactslist - every instance of a contact being added to a list creates a new list recipient. Both the contact and the list need to be created beforehand.

https://dev.mailjet.com/email/reference/contacts/subscriptions#v3_get_listrecipient https://dev.mailjet.com/email/reference/contacts/subscriptions#v3_get_listrecipient_listrecipient_ID https://dev.mailjet.com/email/reference/contacts/subscriptions/#v3_post_listrecipient https://dev.mailjet.com/email/reference/contacts/subscriptions#v3_put_listrecipient_listrecipient_ID https://dev.mailjet.com/email/reference/contacts/subscriptions#v3_delete_listrecipient_listrecipient_ID

Defined in:

mailjet/resources/listrecipient.cr

Class Method Summary

Instance methods inherited from struct Mailjet::Resource

initialize initialize

Constructor methods inherited from struct Mailjet::Resource

new new

Class Method Detail

def self.all(query : Hash | NamedTuple = Hash(String, String).new, params : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Find all contact lists

response = Mailjet::Listrecipient.all
listrecipients = response.data
# or
response.each do |listrecipient|
  listrecipient.list_name
end

[View source]
def self.create(payload : Hash | NamedTuple, params : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Create a listrecipient

listrecipient = Mailjet::Listrecipient.create({
  is_unsubscribed: false,
  contact_alt:     "[email protected]",
  list_id:         12345,
})

[View source]
def self.delete(id : ResourceId, client : Client = Client.new) #

Delete a listrecipient

Mailjet::Listrecipient.delete(12345)

[View source]
def self.find(params : Hash | NamedTuple = Hash(String, String).new, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Find a listrecipient

listrecipient = Mailjet::Listrecipient.find(12345)

[View source]
def self.find(id : ResourceId, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Find a listrecipient

listrecipient = Mailjet::Listrecipient.find(12345)

[View source]
def self.update(params : Hash | NamedTuple = Hash(String, String).new, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Update a listrecipient

listrecipient = Mailjet::Listrecipient.update(12345, {
  is_unsubscribed: true,
})

[View source]
def self.update(id : ResourceId, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new) #

Update a listrecipient

listrecipient = Mailjet::Listrecipient.update(12345, {
  is_unsubscribed: true,
})

[View source]