Forums

Is that possible to send email to article author?

dalibor 16 Dec, 2012
Hello I am using popfeed to send email to article author but I have multilingual site and popfeed doesnt have any translations. If there some possibility to use chronoforms as subit form on the bottom of the page created using BS MyJspace

thank you for your help
GreyHead 16 Dec, 2012
HI dalibor,

I'm sorry I have no experience with either extension. If the BS MyJSpace supports Joomla! Plug-ins then you could probably add a ChronoForms to the page using the ChronoForms plug-in.

Bob
dalibor 16 Dec, 2012
Thank you Bob,
yes it does but I dont know how to setup form to dynamically send emails to site owners.
Site owners are just common joomla users who have rights to create content so maybe if there is some way to send email to joomla article author? Thank you for help.
GreyHead 16 Dec, 2012
Hi dalibor,

If you can get the article ID you can look up the author id and then get their email from the Joomla! User Object. Please see this FAQ which may help.

Bob
dalibor 16 Jan, 2013
Is there any step by step tutorial how make it work?
I need to get mail of the registered user and send the form from that email
and get one field form his community builder profile and send it to this email.
is that possible?

thank you
GreyHead 16 Jan, 2013
Hi dalibor,

No, I'm afraid there isn't a tutorial but it isn't too difficult. Does the article id show in your site URLs?

Bob
dalibor 18 Jan, 2013
yes there is this:
index.php?option=com_myjspace&view=config&id=117&Itemid=169&lang=cs
where 117 is id of page which has been created by one of the users.

I would really appreciate your help on that. Do you offer paid support for this exact issue?

thank you
GreyHead 19 Jan, 2013
Hi dalibor,

Try putting this into a Custom Code action on the form On Submit event.
<?php
if ( !isset($form->data['id']) || !$form->data['id'] ) {
  return false;
}
$db =& JFactory::getDBO();
$query = "
    SELECT `created_by`
        FROM `#__content`
        WHERE `id` = '{$form->data['id']}' ;
";
$db->setQuery($query);
$author_id = $db->loadResult();
if ( $author_id <= 0 ) {
  return false;
}
$author = JFactory::getUser($author->id);
$form->data['author_email'] = $author->email;
?>
You should then be able to use {author_email} in the To box of the Email action.

Bob
This topic is locked and no more replies can be posted.