struct Mailjet::Contact
- Mailjet::Contact
- Mailjet::Resource
- Struct
- Value
- Object
Overview
Contact objects represent the email addresses you intend to send (or have already sent) messages to.
https://dev.mailjet.com/email/reference/contacts/contact/
Defined in:
mailjet/resources/contact.crmailjet/resources/contact/list.cr
mailjet/resources/contact/managecontactlists.cr
Class Method Summary
-
.all(query : Hash | NamedTuple = Hash(String, String).new, params : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Create a contact
-
.create(payload : Hash | NamedTuple, params : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Create a contact
-
.find(params : Hash | NamedTuple = Hash(String, String).new, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Find a contact
-
.find(id : ResourceId, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Find a contact
-
.update(params : Hash | NamedTuple = Hash(String, String).new, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Update a contact
-
.update(id : ResourceId, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
Update a contact
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)
#
Create a contact
response = Mailjet::Contact.all
contacts = response.data
email_addresses = response.map(&.email)
def self.create(payload : Hash | NamedTuple, params : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
#
Create a contact
contact = Mailjet::Contact.create({
name: "Contact name",
email: "[email protected]",
is_excluded_from_campaigns: false,
})
def self.find(params : Hash | NamedTuple = Hash(String, String).new, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
#
Find a contact
contact = Mailjet::Contact.find(123456789)
def self.find(id : ResourceId, query : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
#
Find a contact
contact = Mailjet::Contact.find(123456789)
def self.update(params : Hash | NamedTuple = Hash(String, String).new, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
#
Update a contact
contact = Mailjet::Contact.update(123456789, {
name: "Another name",
is_excluded_from_campaigns: true,
})
def self.update(id : ResourceId, payload : Hash | NamedTuple = Hash(String, String).new, client : Client = Client.new)
#
Update a contact
contact = Mailjet::Contact.update(123456789, {
name: "Another name",
is_excluded_from_campaigns: true,
})