You are here

function notifications_anonymous_destination_method in Notifications 6.4

Get sending method for destination

This is possible because for anonymous users we have just one send method for address type

File

notifications_anonymous/notifications_anonymous.module, line 129
Notifications for anonymous users

Code

function notifications_anonymous_destination_method($destination) {
  $address_type = is_object($destination) ? $destination->type : $destination;
  $allowed_methods = notifications_anonymous_send_methods();
  foreach (messaging_send_methods() as $method => $info) {
    if (isset($allowed_methods[$method]) && isset($info['address_type']) && $address_type == $info['address_type']) {
      return $method;
    }
  }
}