Simplify the replacing of the email with the email from the url
This is a readability improvement. Prior to this change an email coming from the url
from on of the classes that uses this trait is loaded into $this->_toEmail so we have
$this->_toEmail = ['email' => 'x', 'contact_id' => 2])
When $allContactDetails is iterated it checks each row to see if the contact_id matches the
above and if so swaps out the email address when wrangling $toArray from allContactDetails.
This change simply does the swap out before the loop, rather than during it
Also, an if...else is change to an elseif