Changeset 478590
- Timestamp:
- 12/21/2011 02:51:31 PM (14 years ago)
- Location:
- ecampaign/trunk
- Files:
-
- 2 edited
-
EcampaignPetition.class.php (modified) (2 diffs)
-
ecampaign-admin.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ecampaign/trunk/EcampaignPetition.class.php
r477998 r478590 150 150 $fieldSet = $this->fieldSet; 151 151 152 $mailer = self::getPhpMailer(); 153 $post = get_post($fieldSet->postID); 154 $mailer->Subject = !empty($post->post_title) ? $post->post_title : "Petition signed" ; 155 $mailer->From = $fieldSet->campaignEmail ; 156 $mailer->FromName = get_bloginfo("name"); 157 $mailer->AddAddress($fieldSet->visitorEmail, $fieldSet->visitorName); 158 159 160 if ($this->log->recordExists(EcampaignLog::tSign, $fieldSet->visitorEmail, '', $fieldSet->postID)) 152 if (get_option('ec_preventDuplicateActions')) 153 if ($this->log->recordExists(EcampaignLog::tSign, $fieldSet->visitorEmail, '', $fieldSet->postID)) 161 154 { 162 155 $response = array("success" => false, … … 197 190 $fieldSet->target = $recipient; 198 191 } 199 if ($this->log->recordExists(EcampaignLog::tSend, $fieldSet->visitorEmail, $fieldSet->target, $fieldSet->postID)) 192 if (get_option('ec_preventDuplicateActions')) 193 if ($this->log->recordExists(EcampaignLog::tSend, $fieldSet->visitorEmail, $fieldSet->target, $fieldSet->postID)) 200 194 { 201 195 $response = array("success" => false, -
ecampaign/trunk/ecampaign-admin.php
r477786 r478590 80 80 __("This feature prevents emails being sent to the target organisation accidentally. 81 81 Emails normally sent to campaign mailbox and friends are still sent."), ''); 82 83 $adminFields[] = array('ec_preventDuplicateActions', 84 __("Prevent site visitor from sending an email or signing a petition more than once. 85 It is useful to disable when testing. "), 1); 82 86 83 87 // copies of emails are sent here … … 140 144 {friendSend}'); 141 145 146 $tokenHelp = "Use %fieldname to include the value of a captured field. $fieldsHelp"; 142 147 143 148 $adminFields[] = array('ec_verificationEmailSubject', 144 __("Subject of email sent to site visitor with verification code. "),149 __("Subject of email sent to site visitor with verification code. $tokenHelp"), 145 150 __("Verification code for ecampaign action.")); 146 151 147 152 148 153 $adminFields[] = array('ec_verificationEmailBody', 149 __("Body of email sent to site visitor with verification code."), 154 __("Body of email sent to site visitor with verification code. You should include %code and can include %permalink 155 (but the %permalink cannot be used to complete verification). $tokenHelp"), 150 156 __("Dear %visitorName, 151 157 152 158 Thank you for verifying your email address. Please enter %code in the original web page in order to send your email. 153 159 154 You have received this email from the website at 155 160 You have received this email from this webpage 161 162 %subject at 156 163 %permalink 157 164 … … 159 166 160 167 $adminFields[] = array('ec_confirmationEmailSubject', 161 __("Subject of email sent to site visitor to confirm name has been added to petition. "),162 __(" Confirmation, your name has been added to apetition"));168 __("Subject of email sent to site visitor to confirm name has been added to petition. $tokenHelp"), 169 __("Your name has been added to the petition")); 163 170 164 171 165 172 $adminFields[] = array('ec_confirmationEmailBody', 166 __("Text of email sent to site visitor to confirm name has been added to petition. "),173 __("Text of email sent to site visitor to confirm name has been added to petition. You can include %permalink. $tokenHelp"), 167 174 __("Dear %visitorName, 168 175 … … 180 187 181 188 $adminFields[] = array('ec_checkdnsrr', 182 __("Enable checking DNS records for the domain name when checking for a valid E-mail address. "), 'yes');189 __("Enable checking DNS records for the domain name when checking for a valid E-mail address. "), 1); 183 190 184 191 $captchaPresent = file_exists(WP_PLUGIN_DIR . get_option('ec_captchadir') . '/securimage.php') ; … … 196 203 $adminFields[] = array('ec_subscriptionParams', 197 204 __("Parameters passed to instance of class above. ") . 198 Ecampaign::help('#subscription'),' ');205 Ecampaign::help('#subscription'),'optin=checkbox1'); 199 206 200 207 $adminFields[] = array('ec_thirdPartyKey', __("Optional third party API Key used to lookup elected representatives. ") . … … 247 254 </td> 248 255 </tr> 249 250 <?php _renderInputField($prompt, $default, 'ec_campaignEmail') ?>251 252 <?php _renderDualTextArea($prompt, $default, 'ec_layout', 26, 4) ?>253 <?php _renderDualTextArea($prompt, $default, 'ec_petitionLayout', 20, 4) ?>254 <?php _renderDualTextArea($prompt, $default, 'ec_friendsLayout', 6, 2) ?>255 256 <?php _renderDualTextArea($prompt, $default, 'ec_verificationEmailSubject', 1) ?>257 <?php _renderDualTextArea($prompt, $default, 'ec_verificationEmailBody', 4) ?>258 259 <?php _renderDualTextArea($prompt, $default, 'ec_confirmationEmailSubject', 1) ?>260 <?php _renderDualTextArea($prompt, $default, 'ec_confirmationEmailBody', 4) ?>261 262 <?php _renderInputField($prompt, $default, 'ec_mailer') ?>263 264 <tr valign="top">265 <th scope="row"><?php echo $prompt["ec_checkdnsrr"] ?> </th>266 <td><input type="checkbox" name="ec_checkdnsrr" value=1 <?php checked(get_option('ec_checkdnsrr'), 1); ?> /></td>267 </tr>268 269 <?php _renderInputField($prompt, $default, 'ec_captchadir') ?>270 271 256 <?php 257 _renderCheckbox($prompt, $default, 'ec_preventDuplicateActions'); 258 259 _renderInputField($prompt, $default, 'ec_campaignEmail'); 260 261 _renderDualTextArea($prompt, $default, 'ec_layout', 26, 4); 262 _renderDualTextArea($prompt, $default, 'ec_petitionLayout', 20, 4); 263 _renderDualTextArea($prompt, $default, 'ec_friendsLayout', 6, 2); 264 265 _renderDualTextArea($prompt, $default, 'ec_verificationEmailSubject', 1); 266 _renderDualTextArea($prompt, $default, 'ec_verificationEmailBody', 6); 267 268 _renderDualTextArea($prompt, $default, 'ec_confirmationEmailSubject', 1); 269 _renderDualTextArea($prompt, $default, 'ec_confirmationEmailBody', 6); 270 271 _renderInputField($prompt, $default, 'ec_mailer'); 272 _renderCheckbox($prompt, $default, 'ec_checkdnsrr'); 273 274 _renderInputField($prompt, $default, 'ec_captchadir'); 272 275 273 276 $listClassPath = get_option('ec_subscriptionClass'); … … 320 323 <tr valign="top"> 321 324 <th scope="row"><?php echo $prompt[$tname] ?> </th> 322 <td><input type="text" name="<?php echo $tname?>" size='35' value="<?php echo get_option($tname ); ?>" />325 <td><input type="text" name="<?php echo $tname?>" size='35' value="<?php echo get_option($tname,$default[$tname]); ?>" /> 323 326 <?php echo $msg ?></td> 324 327 </tr> … … 326 329 } 327 330 328 331 function _renderCheckbox($prompt, $default, $tname) 332 { 333 ?> 334 <tr valign="top"> 335 <th scope="row"><?php echo $prompt[$tname] ?> </th> 336 <td><input type="checkbox" name="<?php echo $tname?>" value="1" <?php checked(get_option($tname,$default[$tname]), 1); ?> /></td> 337 </tr> 338 <?php 339 } 329 340 330 341 function _renderDualTextArea($prompt, $default, $tname, $rows, $other="") … … 337 348 <tr valign="top"> 338 349 <td>default:<br/><textarea name="<?php echo $tname?>-d" rows=<?php echo "'$rows'" ?> cols='40' readonly='readonly'><?php echo $default[$tname]; ?></textarea></td> 339 <td>current:<br/><textarea name="<?php echo $tname?>" rows=<?php echo "'$rows'" ?> cols='40'><?php echo get_option($tname ); ?></textarea>350 <td>current:<br/><textarea name="<?php echo $tname?>" rows=<?php echo "'$rows'" ?> cols='40'><?php echo get_option($tname, $default[$tname]); ?></textarea> 340 351 <?php echo is_numeric($other) ? _analyzeTemplate(get_option($tname), $other) : $other ?></td> 341 352 </tr>
Note: See TracChangeset
for help on using the changeset viewer.