email administration when inviting a friend

  • maitri
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 1 month ago #14863 by maitri
Hi,

I was wondering if there is a chance I can be emailed when someone chooses to invite a friend.

I know the email gets sent to the address indicated by the person filing the form but, I wonder if there might be a way to
either
set the email address to where the invitation is always sent (the administrator's email). The person in this case would be able to indicate in a different place of the form the email of the friend (I would change the wording with the translator feature) and I the administrator would send manually the invitation

or just be notified when an invitation is sent by the machine....

Thanks, that would be of great help for the purpose of my work.

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 1 month ago #14875 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: email administration when inviting a friend
Unfortunately, that is not possible in the extension. Maybe you can modify the code in the extension alitle so that you will receive the same email as if you were invited. The steps are :

1. Open the file components/com_eventbooking/models/invite.php

2. Find the code below :
Code:
$emails = explode("\r\n", $data['friend_emails']);

3. Change it to :
Code:
$emails = explode("\r\n", $data['friend_emails']); $emails[] = 'email@domain.com' ;

Please make sure you replace email@domain.com with your actual email. After that , you will receive notification when someone invites a friend .

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • maitri
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 1 month ago - 12 years 1 month ago #14879 by maitri
Hi Tuan,

This option would be perfect. However, I have changed the code as you mentioned and the email is still sent to the friend's address. I am attaching the invite.php file that I have modified, please let me know if I missed something, although I am pretty sure followed your indications.

Thanks.

Just in case the attached file does not upload correctly, these is the portion of the file with the code with the changes on it:

$body = $config->invitation_email_body ;
$subject = str_replace('[EVENT_TITLE]', $event->title, $subject) ;
foreach ($replaces as $key=>$value) {
$key = strtoupper($key) ;
$body = str_replace("[$key]", $value, $body) ;
}
$emails = explode("\r\n", $data);$emails[] = 'info@bitacoraeventos.com';
$names = explode("\r\n", $data);
for ($i = 0 , $n = count($emails) ; $i < $n ; $i++) {
$emailBody = $body ;
$email = $emails[$i] ;
$name = $names[$i] ;
if ($name && $email) {
$emailBody = str_replace('[NAME]', $name, $emailBody) ;
//Send emails here
JUtility::sendMail($fromEmail, $fromName, $email, $subject, $emailBody, 1);
Last edit: 12 years 1 month ago by maitri. Reason: not sure the attached file uploaded

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 1 month ago #14880 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: email administration when inviting a friend
Please zip the file before attaching .

Please Log in or Create an account to join the conversation.

  • maitri
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 1 month ago - 12 years 1 month ago #14881 by maitri
Here's the file invite.php

Thanks.

ups... I'm not sure that the file is uploading even ziped but hopefully the code pasted previously would be enough.

thank you.
Last edit: 12 years 1 month ago by maitri.

Please Log in or Create an account to join the conversation.

  • maitri
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 1 month ago #14882 by maitri
Hi Tuan,

While waiting for you to get back, I have a second question that would be really helpful and I wonder if it can be done somehow: I noticed that for events that don´t allow registration the invite a friend option doesn't come out. Is there a way it can be configured for it to appear on them as well?

Also, you don't get the option to invite untill you go into the details of the events, at the end of the page, would it be possible for the button to appear in the category layout page after the brief description of the event next to the "details" button?

This way, we increase the chances of people sharing/inviting friends to the events.

Thanks a lot.

Please Log in or Create an account to join the conversation.

  • maitri
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 years 1 month ago #14952 by maitri
Any updates on this?

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 1 month ago #14973 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: email administration when inviting a friend

Here's the file invite.php

Thanks.

ups... I'm not sure that the file is uploading even ziped but hopefully the code pasted previously would be enough.

thank you.


=> You still forgot to attach the file, so I could not check it . Maybe you can email me directly to contact@joomdonation.com so that I can check the code you modified .

Tuan

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
12 years 1 month ago #14974 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: email administration when inviting a friend

While waiting for you to get back, I have a second question that would be really helpful and I wonder if it can be done somehow: I noticed that for events that don´t allow registration the invite a friend option doesn't come out. Is there a way it can be configured for it to appear on them as well?


=> Please get this file, unzip it, get the file and upload it to components/com_eventbooking/views/event/tmpl folder. After that, it should work as expected .

Also, you don't get the option to invite untill you go into the details of the events, at the end of the page, would it be possible for the button to appear in the category layout page after the brief description of the event next to the "details" button?


=> Unfortunately, the feature is not supported in the extension. So if you want to have it, you will have to customize the code yourself .

Tuan

Attachment default-20120416.zip not found

Attachments:

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc