This commit is contained in:
rahul shukla 2021-01-20 15:00:37 +05:30
parent 9f67e46ef8
commit ed1ae6aed5
1 changed files with 1 additions and 10 deletions

View File

@ -90,18 +90,9 @@ class Campaign
*/
public function getEmailAddresses($campaign)
{
$newsletterEmails = app('\Webkul\Core\Repositories\SubscribersListRepository')->getModel()
->where('is_subscribed', 1)
->where('channel_id', $campaign->channel_id)
->get('email');
$customerGroupEmails = $campaign->customer_group->customers()->where('subscribed_to_news_letter', 1)->get('email');
$emails = [];
foreach ($newsletterEmails as $row) {
$emails[] = $row->email;
}
$customerGroupEmails = $campaign->customer_group->customers()->where('subscribed_to_news_letter', 1)->get('email');
foreach ($customerGroupEmails as $row) {
$emails[] = $row->email;