Commit 073ab415 authored by Jamie McClelland's avatar Jamie McClelland

offer copy/paste links for publicizing the petition.

parent 6ff655d0
......@@ -142,10 +142,22 @@ function petitionemail_civicrm_buildForm( $formName, &$form ) {
$defaults['matching_group_id' . $i] = $dao->matching_group_id;
$i++;
}
// We have to build this URL by hand to avoid having the curly
// braces get escaped.
$base_url = CIVICRM_UF_BASEURL . "civicrm/petition/sign?sid=$survey_id&reset=1";
$personal_url = $base_url . '&{contact.checksum}&cid={contact.contact_id}';
$defaults['links'] = ts("Personal link (use this link if you are sending it via PowerBase Mail, it will auto fill with the user's address): ") . "\n" .
$personal_url . "\n\n" . ts("General link: ") . $base_url;
$form->setDefaults($defaults);
}
}
else {
$form->setDefaults(
array(
'links' => ts("Please save the petition first, then you can copy and paste the link to sign the petition.")
)
);
}
// Now add our extra fields to the form.
$form->add('checkbox', 'email_petition', ts('Send an email to a target'));
......@@ -210,6 +222,9 @@ function petitionemail_civicrm_buildForm( $formName, &$form ) {
$custom_message_field_options);
$form->add('textarea', 'default_message', ts('Default Message'), 'rows=20');
$form->add('text', 'subject', ts('Email Subject Line'), array('size' => 70));
$form->add('textarea', 'links', ts('Links to sign the petition'), 'rows=5');
}
}
......
......@@ -13,7 +13,7 @@
<td class="view-value">{$form.default_message.html}
<div class="description">{ts}Enter the default message to be included in the email.{/ts}</div></td>
</tr>
<tr class="crm-campaign-survey-form-block-message_field">
<tr class="crm-campaign-survey-form-block-message_field">
<td class="label">{$form.message_field.label}</td>
<td class="view-value">{$form.message_field.html}
<div class="description">{ts}Select a field that will have the signer's custom message. Make sure it is included in the Activity Profile you selected.{/ts}</div></td>
......@@ -74,5 +74,10 @@
</div>
</td>
</tr>
<tr class="crm-campaign-survey-form-block-links_field">
<td class="label">{$form.links.label}</td>
<td class="view-value">{$form.links.html}
<div class="description">{ts}Sending an email to publicize this petition? Here are your links!{/ts}</div></td>
</tr>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment