Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,22 @@ function dosomething_signup_user_signup($nid, $account = NULL) {
);
dosomething_user_send_message_request('campaign_signup', $params);
// Set success message.
$message = t("You're signed up!") . '<br />';
$message .= t("Get started with") . ' ' . $node->title . ' ' . t("below!");
drupal_set_message($message);
dosomething_signup_set_signup_message($node->title);
}
}

/**
* Sets Drupal message for a signup for given $title.
*
* @param string $title
* Title to display within the Drupal message.
*/
function dosomething_signup_set_signup_message($title) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe title should default to NULL?

$message = t("You're signed up for") . ' <em>' . $title . '</em>! ';
$message .= t("Get started below.");
drupal_set_message($message);
}

/**
* Returns array of nid's that a user has signed up for.
*
Expand Down
11 changes: 9 additions & 2 deletions lib/modules/dosomething/dosomething_user/dosomething_user.module
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ function dosomething_user_clean_cell_number($number) {
* - impact_noun
*/
function dosomething_user_send_message_request($origin, $params = NULL) {
if (!module_exists('message_broker_producer')) return FALSE;

$payload = array(
'activity' => $origin,
'email' => $params['email'],
Expand Down Expand Up @@ -446,8 +448,13 @@ function dosomething_user_send_message_request($origin, $params = NULL) {
);
break;
}
if (module_exists('message_broker_producer')) {
message_broker_producer_request('produceTransactional', $payload);

try {
return message_broker_producer_request('produceTransactional', $payload);
}
catch (Exception $e){
watchdog('dosomething_user', $e, array(), WATCHDOG_ERROR);
return FALSE;
}
}

Expand Down