forked from friendica/friendica-addons
		
	Some Renames:
- EMail => EMail - toEmail => toAddress - fromEmail => fromAddress
This commit is contained in:
		
					parent
					
						
							
								49254a8307
							
						
					
				
			
			
				commit
				
					
						ae5ebf1e89
					
				
			
		
					 4 changed files with 8 additions and 8 deletions
				
			
		
							
								
								
									
										40
									
								
								securemail/SecureTestEmail.php
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								securemail/SecureTestEmail.php
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
<?php
 | 
			
		||||
 | 
			
		||||
namespace Friendica\Addon\securemail;
 | 
			
		||||
 | 
			
		||||
use Friendica\App;
 | 
			
		||||
use Friendica\App\BaseURL;
 | 
			
		||||
use Friendica\Core\Config\IConfig;
 | 
			
		||||
use Friendica\Core\PConfig\IPConfig;
 | 
			
		||||
use Friendica\Object\Email;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class for creating a Test email for the securemail addon
 | 
			
		||||
 */
 | 
			
		||||
class SecureTestEmail extends Email
 | 
			
		||||
{
 | 
			
		||||
	public function __construct(App $a, IConfig $config, IPConfig $pConfig, BaseURL $baseUrl)
 | 
			
		||||
	{
 | 
			
		||||
		$sitename = $config->get('config', 'sitename');
 | 
			
		||||
 | 
			
		||||
		$hostname = $baseUrl->getHostname();
 | 
			
		||||
		if (strpos($hostname, ':')) {
 | 
			
		||||
			$hostname = substr($hostname, 0, strpos($hostname, ':'));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$sender_email = $config->get('config', 'sender_email');
 | 
			
		||||
		if (empty($sender_email)) {
 | 
			
		||||
			$sender_email = 'noreply@' . $hostname;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$subject = 'Friendica - Secure Mail - Test';
 | 
			
		||||
		$message = 'This is a test message from your Friendica Secure Mail addon.';
 | 
			
		||||
 | 
			
		||||
		// enable addon for test
 | 
			
		||||
		$pConfig->set(local_user(), 'securemail', 'enable', 1);
 | 
			
		||||
 | 
			
		||||
		parent::__construct($sitename, $sender_email, $sender_email, $a->user['email'],
 | 
			
		||||
			$subject, "<p>{$message}</p>", $message,
 | 
			
		||||
			'', local_user());
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue