gde_change_phpmailer

The Google Doc Embedder gde change phpmailer function.

Description

gde_change_phpmailer( $phpmailer ); 

Parameters (1)

0. $phpmailer
The phpmailer.

Usage

  1. if ( !function_exists( 'gde_change_phpmailer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/libs/lib-formsubmit.php'; 
  3.  
  4. // The phpmailer. 
  5. $phpmailer = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_change_phpmailer($phpmailer); 
  9.  

Defined (1)

The function is defined in the following location(s).

/libs/lib-formsubmit.php  
  1. function gde_change_phpmailer( $phpmailer ) { 
  2. // gather settings and profiles 
  3. $datasrc = GDE_PLUGIN_URL . 'libs/lib-service.php?json=all'; 
  4. $response = wp_remote_get( $datasrc ); 
  5. if ( !is_wp_error( $response ) && strlen( strip_tags( $response['body'] ) ) > 0 ) { 
  6. $contents = $response['body']; 
  7. $file = "gde-export.txt"; 
  8. } else { 
  9. $contents = "Error attaching export data."; 
  10. $file = "export-error.txt"; 
  11. $phpmailer->AddStringAttachment( $contents, $file, 'base64', 'text/plain' ); 
  12.  
  13. // gather dx log 
  14. unset( $file ); 
  15. $blogid = get_current_blog_id(); 
  16. $datasrc = GDE_PLUGIN_URL . 'libs/lib-service.php?viewlog=all&blogid=' . $blogid; 
  17. $response = wp_remote_get( $datasrc ); 
  18. if ( is_wp_error( $response ) ) { 
  19. $contents = "[InternetShortcut]\nURL=" . $datasrc ."\n"; 
  20. $file = "remote-dx-log.url"; 
  21. } else if ( strlen( $response['body'] ) > 0 ) { 
  22. $contents = $response['body']; 
  23. $file = "dx-log.txt"; 
  24. if ( isset( $file ) ) { 
  25. $phpmailer->AddStringAttachment( $contents, $file, 'base64', 'text/plain' );