struct Mailjet::Messagehistory

Overview

Retrieve the event history (sending, open, click etc.) for a specific message.

https://dev.mailjet.com/email/reference/messages/#v3_get_messagehistory_message_ID

Defined in:

mailjet/resources/messagehistory.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) #

Fetches the history of a message

response = Mailjet::Messagehistory.all(params: {id: 576460754655154659})
response.data.first.event_type
# => "opened"

[View source]
def self.all(id : Int64 | String, client : Client = Client.new) #

Convenience method allowing to pass the message id and returning the array of events directly

events = Mailjet::Messagehistory.all(576460754655154659)
events.first.event_type
# => "opened"

[View source]