msg_dispose

March 26, 2020 Contributors

Name

msg_dispose — Called immediately prior to disposing of an ec_message

Synopsis

#include "ec_message.h"
#include "io_wrapper_int.h"

| int **msg_dispose** ( | closure, |   |
|   | msg); |   |

void * <var class="pdparam">closure</var>;
ec_message * <var class="pdparam">msg</var>;

Description

**Configuration Change. ** This hook point is available as of Momentum version 3.5.5.

Note

When a message fails, this hook is typically used to reroute messages to another channel. For example, you can use this hook point to convert an Apple or Google push notification to an SSMP message. This hook is accessible from Lua via the generic_delivery_msg_dispose callout.

This hook is called right before an ec_message is finally disposed as delivered successfully or failed, either permanently or temporarily. The context variable VCTX_KEY_DLV_RESPONSE_STATUS holds the protocol status code that indicates a message’s status. The context variable VCTX_KEY_DLV_RESPONSE_STATUS_DETAIL holds the detailed string description of the status code.

Use ec_message_context_get to determine the value of context variables. These values will differ depending upon the protocol. Use ec_message_get_delivery_method to determine how a message was sent.

Parameters

closure

The closure function.

msg

The message. For a description of this data type see “ec_message”.

Return Values

Currently the return value has no significance.

Threading

This hook will be called in the Scheduler thread.

See Also

Momentum for Mobile Push Notifications and pre_mailq_message_requeue