Changeset 1853642
- Timestamp:
- 04/05/2018 06:48:34 PM (8 years ago)
- Location:
- draft-notify/tags
- Files:
-
- 3 added
- 1 edited
-
V1.0/draft-notify.php (modified) (5 diffs)
-
V1.5 (added)
-
V1.5/draft-notify.php (added)
-
V1.5/readme.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
draft-notify/tags/V1.0/draft-notify.php
r680651 r1853642 60 60 if($canEmail) 61 61 { 62 $message = "A draft was created: '" . get_bloginfo('name') . "'\n"; 62 $message = get_option('draftnotifycustomheader'); 63 $message .= "A draft was created: '" . get_bloginfo('name') . "'\n"; 63 64 $message .= "Post Title: " . $result->post_title . "\n"; 64 65 $message .= "Author's Username: " . $result->user_login . "\n"; 65 66 67 $message = get_option('draftnotifycustomfooter'); 66 68 //$message .= var_export($result, true); 67 69 … … 84 86 } 85 87 86 mail($recipient, $subject, $message); 88 $headers = ""; 89 if(get_option('draftnotifyfromaddress')!="") 90 { 91 $headers .= "From: ".get_option('draftnotifyfromaddress')."\r\n"; 92 } 93 if(get_option('draftnotifyreplytoaddress')!="") 94 { 95 $headers .= "Reply-to: ".get_option('draftnotifyreplytoaddress')."\r\n"; 96 } 97 98 99 mail($recipient, $subject, $message, $headers); 87 100 88 101 if(!in_array($id, $emailedEx)) … … 118 131 register_setting( 'draftnotify_options', 'draftnotifyemailrevisions' ); 119 132 register_setting( 'draftnotify_options', 'draftnotifyemailedlist' ); 133 register_setting( 'draftnotify_options', 'draftnotifyposttypes1' ); 134 register_setting( 'draftnotify_options', 'draftnotifyposttypes2' ); 135 register_setting( 'draftnotify_options', 'draftnotifycustomheader' ); 136 register_setting( 'draftnotify_options', 'draftnotifycustomfooter' ); 137 register_setting( 'draftnotify_options', 'draftnotifyfromaddress' ); 138 register_setting( 'draftnotify_options', 'draftnotifyreplytoaddress' ); 120 139 } 121 140 … … 159 178 </tr> 160 179 <tr> 180 <td valign='top'><b>Send to 1 Admin:</b></td> 181 <td valign='top'>"; 182 183 // create a dynmaic list based on the admin roles. 184 185 $savedSelectVal = get_option('draftnotifyalevel'); 186 $temp =(strlen($savedSelectVal) == 0 || $savedSelectVal < 0)?" selected='selected'":""; 187 188 $tempArr = get_editable_roles(); 189 190 foreach($tempArr as $role=>$roleArr) 191 { 192 $tempLevel = getTempLevel($roleArr['capabilities']); 193 $temp =($savedSelectVal==$tempLevel)?" selected='selected'":""; 194 echo "{$role}"; 195 } 196 197 echo "</select></td> 198 <td valign='top'>Admin Accounts are listed here. Select those accounts which should be emailed. These will be added to the list of emails you entered above and ignored if you select a whole user group to email.</td> 199 </tr>"; 200 201 // Post Type 202 echo "<tr> 203 <td valign='top'><b>Send Emails for These types of articles:</b></td> 204 <td valign='top'>"; 205 $savedSelectVal = get_option('draftnotifyposttypes1'); 206 $checked = ($savedSelectVal == "page")?" checked":""; 207 echo "<input type='checkbox' id='draftnotifypageselection' name='draftnotifypageselection' value='page'{$checked}><label for='draftnotifypageselection'>Pages</label>"; 208 $savedSelectVal = get_option('draftnotifyposttypes2'); 209 $checked = ($savedSelectVal == "post")?" checked":""; 210 echo "<input type='checkbox' id='draftnotifypostselection' name='draftnotifypostselection' value='post'{$checked}><label for='draftnotifypostselection'>Posts</label>"; 211 212 213 echo "</td> 214 <td valign='top'>Choose the types of artiles you want emails for.</td> 215 </tr>"; 216 217 // Revisions. 218 echo "<tr> 161 219 <td valign='top'><b>Send Emails when revisions are made:</b></td> 162 220 <td valign='top'><select id='draftnotifyemailrevisions' name='draftnotifyemailrevisions' > "; … … 168 226 </select></td> 169 227 <td valign='top'>If you would like an email every time someones saves a revision to the draft, select Yes, otherwise, select NO and you'll only get an email the first time the draft is saved.</td> 170 </tr> 171 </table>"; 228 </tr>"; 229 230 // From Address 231 echo "<tr> 232 <td valign='top'><b>Custom From Address:</b></td> 233 <td valign='top'><input id='draftnotifyfromemail' name='draftnotifyfromemail' size='40' type='text' value='".get_option('draftnotifyfromaddress')."' /> 234 <td valign='top'>Please enter an email address to appear as the sent from address of the email.</td> 235 </td></tr>"; 236 // Reply To 237 echo "<tr> 238 <td valign='top'><b>Custom Reply-To Address:</b></td> 239 <td valign='top'><input id='draftnotifyreplyto' name='draftnotifyreplyto' size='40' type='text' value='".get_option('draftnotifyreplytoaddress')."' /> 240 <td valign='top'>Please enter an email address to be put in the reply-to field of the email.</td> 241 </td></tr>"; 242 243 // Header 244 echo "<tr> 245 <td valign='top'><b>Custom Header text:</b></td> 246 <td valign='top'><textarea id='draftnotifyheader' name='draftnotifyheader' rows='3' cols='75'>".get_option('draftnotifycustomheader')."</textarea> 247 <td valign='top'>Text to be placed at the beginning of every email.</td> 248 </td></tr>"; 249 250 // Footer 251 echo "<tr> 252 <td valign='top'><b>Custom Footer text:</b></td> 253 <td valign='top'><textarea id='draftnotifyfooter' name='draftnotifyfooter' rows='3' cols='75'>".get_option('draftnotifycustomfooter')."</textarea> 254 <td valign='top'>Text to be placed at the end of every email.</td> 255 </td></tr>"; 256 257 echo "</table>"; 172 258 173 259 submit_button();
Note: See TracChangeset
for help on using the changeset viewer.