Changeset 1334054
- Timestamp:
- 01/22/2016 10:37:55 PM (10 years ago)
- Location:
- reach-seo/trunk
- Files:
-
- 2 edited
-
classes/rest-api.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
reach-seo/trunk/classes/rest-api.php
r1334005 r1334054 136 136 $settings = $settings[ 'basic' ]; 137 137 138 // 0. Check that the user has valid email settings 139 if ( !isset($settings[ 'reachseo-email-host' ]) || 140 !isset($settings[ 'reachseo-email-port' ]) || 141 !isset($settings[ 'reachseo-email-username' ]) || 142 !isset($settings[ 'reachseo-email-password' ]) ) { 143 return new WP_JSON_Response( array( 144 'error' => 'You must add your email settings before sending outreach emails!', 145 'code' => 400 146 )); 147 } 148 138 149 try { 139 150 // 1. Setup the Transport … … 168 179 )); 169 180 // 3. update the opportunity in db 170 } catch( Swift_TransportException $e ) { 171 $message = $e->getMessage(); 181 } catch ( Exception $e ) { 182 183 if ( $e instanceof Swift_TransportException ) { 184 $message = $e->getMessage(); 185 } else { 186 $message = 'We could not send your email. This can be a result of invalid email addresses or email settings.'; 187 } 188 172 189 return new WP_JSON_Response( array( 173 190 'error' => $message, 174 'code' => $e->getCode(), 175 'settings' => $settings 191 'code' => $e->getCode() 176 192 )); 177 193 } -
reach-seo/trunk/readme.txt
r1334005 r1334054 4 4 Requires at least: 3.5 5 5 Tested up to: 4.3.1 6 Stable tag: 1.0.16 Stable tag: trunk 7 7 License: GPLv3 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html
Note: See TracChangeset
for help on using the changeset viewer.