struct Mailjet::Contactfilter

Overview

Segmentation is an extremely useful tool used to target a specific group of customers with a dedicated campaign. Create segments based on contact properties or the contact activity (opens, clicks). Segmentation helps you focus your campaigns on specific demographics, create re-engagement campaigns, etc.

https://dev.mailjet.com/email/reference/segmentation/

Defined in:

mailjet/resources/contactfilter.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 contactfilters

response = Mailjet::Contactfilter.all
contactfilters = response.data

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

Create a contactfilter

contactfilter = Mailjet::Contactfilter.create({
  description: "Users that have not clicked on an email link in the last 14 days",
  expression:  "((not hasclickedsince(14)))",
  name:        "Inactive customers",
})

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

Delete a contactfilter

Mailjet::Contactfilter.delete(112334)

[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 contactfilter

contactfilter = Mailjet::Contactfilter.find(112334)

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

Find a contactfilter

contactfilter = Mailjet::Contactfilter.find(112334)

[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 contactfilter

contactfilter = Mailjet::Contactfilter.update(112334, {
  description: "Users that have not clicked on an email link in the last 7 days",
  expression:  "((not hasclickedsince(7)))",
  name:        "Inactive customers",
})

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

Update a contactfilter

contactfilter = Mailjet::Contactfilter.update(112334, {
  description: "Users that have not clicked on an email link in the last 7 days",
  expression:  "((not hasclickedsince(7)))",
  name:        "Inactive customers",
})

[View source]