P
Pals
Guest
Hi,
I have PHP Array Object like given below.
Array
(
[0] => stdClass Object
(
[user_id] => 322
[order_id] => 40
[product_name] => PRODUCT ONE
[product_id] => 81
[name] => USER1
=> [email protected]
)
[1] => stdClass Object
(
[user_id] => 322
[order_id] => 40
[product_name] =>PRODUCT TWO
[product_id] => 82
[name] => USER1
[email] => [email protected]
)
[2] => stdClass Object
(
[user_id] => 322
[order_id] => 39
[product_name] =>PRODUCT TWO
[product_id] => 82
[name] => USER2
[email] => [email protected]
)
)
I'm sending email according to this array..
The code is like this
for (i=0; i<count(products); i++){
sendEmail(products[i]->email, products[i]->orderid, array(products[i]->product_name));
}
I know the above code sends mail for each "array object element" (array[i])
but,
I like to send send a single email for the ArrayObject having same order_id with all product names
ie., i'd like to send a mail to [email protected] stating PRODUCT ONE & TWO
and [email protected] stating [email protected].
Someone suggest a solution please..
Thanks.
I have PHP Array Object like given below.
Array
(
[0] => stdClass Object
(
[user_id] => 322
[order_id] => 40
[product_name] => PRODUCT ONE
[product_id] => 81
[name] => USER1
=> [email protected]
)
[1] => stdClass Object
(
[user_id] => 322
[order_id] => 40
[product_name] =>PRODUCT TWO
[product_id] => 82
[name] => USER1
[email] => [email protected]
)
[2] => stdClass Object
(
[user_id] => 322
[order_id] => 39
[product_name] =>PRODUCT TWO
[product_id] => 82
[name] => USER2
[email] => [email protected]
)
)
I'm sending email according to this array..
The code is like this
for (i=0; i<count(products); i++){
sendEmail(products[i]->email, products[i]->orderid, array(products[i]->product_name));
}
I know the above code sends mail for each "array object element" (array[i])
but,
I like to send send a single email for the ArrayObject having same order_id with all product names
ie., i'd like to send a mail to [email protected] stating PRODUCT ONE & TWO
and [email protected] stating [email protected].
Someone suggest a solution please..
Thanks.