Skip to content

Commit

Permalink
2.1.2-rc.2
Browse files Browse the repository at this point in the history
NEW
Integrated SDK for Feedback and support.
Added “Start wizard” button in setup notification to optimize UX for the end-user.

Improved
Removed unused code

FIX
“Less secure App� Banner appearing in non-appropriate cases
  • Loading branch information
smusman98 committed Jul 18, 2022
1 parent 285a786 commit 5206ebf
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions Postman/Postman-Mail/PostmanSendinblueMailEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ public function send( PostmanMessage $message ) {

$sender = $message->getFromAddress();
$senderEmail = !empty( $sender->getEmail() ) ? $sender->getEmail() : $options->getMessageSenderEmail();
$senderName = !empty( $sender->getName() ) ? $sender->getName() : $options->getMessageSenderName();
$senderName = !empty( $sender->getName() ) ? $sender->getName() : $options->getMessageSenderName();
$headers = array();

$sender->log( $this->logger, 'From' );
$sender->log( $this->logger, 'From' );

$sendSmtpEmail['sender'] = array(
'name' => $senderName,
Expand All @@ -109,9 +109,13 @@ public function send( PostmanMessage $message ) {
if ( !array_key_exists( $recipient->getEmail(), $duplicates ) ) {

$tos[] = array(
'email' => $recipient->getEmail(),
'name' => '$recipient->getName()'
'email' => $recipient->getEmail()
);

if( !empty( $recipient->getName() ) ) {
$tos['name'] = $recipient->getName();
}

$duplicates[] = $recipient->getEmail();

}
Expand All @@ -138,9 +142,12 @@ public function send( PostmanMessage $message ) {
// $replyTo is null or a PostmanEmailAddress object
if ( isset( $replyTo ) ) {
$sendSmtpEmail['replyTo'] = array(
'email' => $replyTo->getEmail(),
'name' => '$replyTo->getName()'
'email' => $replyTo->getEmail()
);

if( !empty( $replyTo->getName() ) ) {
$sendSmtpEmail['name'] = $replyTo->getName();
}
}

// add the Postman signature - append it to whatever the user may have set
Expand Down Expand Up @@ -176,16 +183,20 @@ public function send( PostmanMessage $message ) {

$recipient->log($this->logger, 'Cc');
$cc[] = array(
'name' => '$recipient->getName()',
'email' => $recipient->getEmail()
);

if( !empty( $recipient->getName() ) ) {
$cc['name'] = $recipient->getName();
}

$duplicates[] = $recipient->getEmail();

}

}
if( !empty( $cc ) )
$sendSmtpEmail['cc'] = $cc;
$sendSmtpEmail['cc'] = $cc;

$bcc = array();
$duplicates = array();
Expand All @@ -205,7 +216,7 @@ public function send( PostmanMessage $message ) {
}

if( !empty( $bcc ) )
$sendSmtpEmail['bcc'] = $bcc;
$sendSmtpEmail['bcc'] = $bcc;

// add attachments
$this->logger->debug( 'Adding attachments' );
Expand Down Expand Up @@ -237,12 +248,12 @@ public function send( PostmanMessage $message ) {
}

$response = $apiInstance->sendTransacEmail($sendSmtpEmail);
$this->transcript = print_r( $response, true );
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
$this->transcript .= print_r( $sendSmtpEmail, true );
$this->logger->debug( 'Transcript=' . $this->transcript );
$this->transcript = print_r( $response, true );
$this->transcript .= PostmanModuleTransport::RAW_MESSAGE_FOLLOWS;
$this->transcript .= print_r( $sendSmtpEmail, true );
$this->logger->debug( 'Transcript=' . $this->transcript );
} catch (Exception $e) {

$this->transcript = $e->getMessage();
Expand Down

0 comments on commit 5206ebf

Please sign in to comment.