Skip to main content
added 411 characters in body
Source Link
Diana
  • 5.3k
  • 1
  • 11
  • 26
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it$/", $customerEmail)) {
   // do something
}

LE based on commnent

if you want to check if the email is one of marketplace.amazon.it OR marketplace.amazon.de then this is the code:

$customerEmail = $order->getData('customer_email');
$needles = ['@marketplace.amazon.it', '@marketplace.amazon.de'];

foreach ($needles as $needle) {
   if (preg_match("/{$needle}$/", $customerEmail)) {
      // do something
   }
}
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it$/", $customerEmail)) {
   // do something
}
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it$/", $customerEmail)) {
   // do something
}

LE based on commnent

if you want to check if the email is one of marketplace.amazon.it OR marketplace.amazon.de then this is the code:

$customerEmail = $order->getData('customer_email');
$needles = ['@marketplace.amazon.it', '@marketplace.amazon.de'];

foreach ($needles as $needle) {
   if (preg_match("/{$needle}$/", $customerEmail)) {
      // do something
   }
}
added 157 characters in body
Source Link
Diana
  • 5.3k
  • 1
  • 11
  • 26
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.itit$/", $customerEmail)) {
   // do something
}
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it/", $customerEmail)) {
   // do something
}
$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it$/", $customerEmail)) {
   // do something
}
Post Undeleted by Diana
Post Deleted by Diana
Source Link
Diana
  • 5.3k
  • 1
  • 11
  • 26

$customerEmail = $order->getData('customer_email');
if (preg_match("/@marketplace.amazon.it/", $customerEmail)) {
   // do something
}