Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
extensions
cc.tadpole.petitionemail
Commits
073ab415
Commit
073ab415
authored
Nov 14, 2014
by
Jamie McClelland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
offer copy/paste links for publicizing the petition.
parent
6ff655d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
petitionemail.php
petitionemail.php
+16
-1
templates/CRM/Campaign/Form/Petitionemail.tpl
templates/CRM/Campaign/Form/Petitionemail.tpl
+7
-2
No files found.
petitionemail.php
View file @
073ab415
...
...
@@ -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'
);
}
}
...
...
templates/CRM/Campaign/Form/Petitionemail.tpl
View file @
073ab415
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment