Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
extensions
cc.tadpole.petitionemail
Commits
d27cd479
Commit
d27cd479
authored
Jun 29, 2015
by
Kevin Cristiano
🌎
Browse files
Merge pull request #4 from progressivetech/petition-activity-only
only send emails if we are sure it's a petition activity.
parents
6ba5b962
382530b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
petitionemail.php
View file @
d27cd479
...
...
@@ -1162,12 +1162,14 @@ function petitionemail_parse_email_line($line) {
* signature.
*/
function
petitionemail_get_petition_id_for_activity
(
$activity_id
)
{
// If there is a related civicrm_petition_email record
, we are good to go.
//
NOTE: source_record_id stores the survey_id which is the same thing
// as the petition_id for our purposes.
// If there is a related civicrm_petition_email record
and it is the right
//
activity type, then we are good to go. NOTE: source_record_id stores the
//
survey_id which is the same thing
as the petition_id for our purposes.
$sql
=
"SELECT a.source_record_id FROM civicrm_activity a JOIN
civicrm_petition_email pe ON a.source_record_id = pe.petition_id
WHERE a.id = %0"
;
JOIN civicrm_option_value ov ON a.activity_type_id = ov.value
JOIN civicrm_option_group og ON ov.option_group_id = og.id
WHERE a.id = %0 AND og.name = 'activity_type' AND ov.name = 'Petition'"
;
$params
=
array
(
0
=>
array
(
$activity_id
,
'Integer'
));
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$params
);
$dao
->
fetch
();
...
...
Write
Preview
Supports
Markdown
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