Advertisement:

Author Topic: how do anonymous users receive a email copy of their message they post item page  (Read 757 times)

mattlok

  • Newbie
  • *
  • Posts: 40
hi everybody,

is there a way that anonymous users who post messages to the seller's item post can get an email copy of the post and their message?

Just like how Kijiji works.  If i see an item i like, I send a message on their item page.  In my email, i get a link to the item post and the message i sent to the seller.

Is this possible to do or is there a setting i can turn on?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Hi,

http://forums.osclass.org/general-help/receiving-copy-of-contact-email/msg130660/#msg130660

That will work for any user, anonymous or not. If you want to restrict it to non-logged users:

Code: [Select]
<?php
function cust_item_inquiry_sender_copy($mail) {

    if (
Params::getParam('action') == 'contact_post' && !osc_is_web_user_logged_in()) $mail->AddBCC(Params::getParam('yourEmail'));
    return 
$mail;
}

osc_add_filter('init_send_mail''cust_item_inquiry_sender_copy');
?>


Regards

mattlok

  • Newbie
  • *
  • Posts: 40
Hi Teseo,

Thanks so much for the code.

It worked perfectly.

I added the code at the end of me function.php file and it worked!

Amazing, thank-you so much.

Your code should be in the tips section.

I was also going to ask if there was a way for the email sent to the anonymous users to have a different email template.

I know I am now stretching it.  But i figure it doen't hurt to ask :)

teseo

  • Hero Member
  • *****
  • Posts: 6169
I'm afraid that would be more complicated. :(

You see, this function just adds a BCC (a hidden copy). Indeed it might be used to alter the body of the message, but then the publisher also would receive the mail with the modified text.

To achieve what you want, you'd need to build a different mail object just for the person making inquiries.

Regards

mattlok

  • Newbie
  • *
  • Posts: 40
Hey Teseo,

Thanks for replying back.

Well it was worth asking just in case.

Otherwise your script works great, there is a link on the message body that takes the user back to the Ad so that works out.

Thanks again, you're a life saver.