Hello,
what is the right way to send emails with elgg so that I can use all the buildin functions?
Thank you Tobi
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Stumpy@stumpyadmin
Stumpy - 0 likes
- tobi@telltarget
tobi - 0 likes
- rjcalifornia@rjcalifornia
rjcalifornia - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- Chidozie Agbakwuru@jetli004
Chidozie Agbakwuru - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Chidozie Agbakwuru@jetli004
Chidozie Agbakwuru - 0 likes
- Chidozie Agbakwuru@jetli004
Chidozie Agbakwuru - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Chidozie Agbakwuru@jetli004
Chidozie Agbakwuru - 0 likes
You must log in to post replies.I dnt know if this might help you
http://community.elgg.org/pg/plugins/project/384769/developer/costelloc/phpmailer
I will have a look in the code of this plugin, perhaps I find what I am looking for.
I have to know how to send emails in my own plugin. I guess just using the php mail function isn't the best way.
Emails? Like sending emails to your users?
http://community.elgg.org/pg/plugins/jeabakker/read/384753?release=493247
Rodolfo Hernandez
Arvixe/Elgg Community Liaison
Programmatically you want either elgg_send_email() or notify_user() with the method override set to email.
hi,
I'm fairly new to php and elgg but I just set up an elgg site on version 1.8.16 and I'l like users to be able to send blog posts by email from within the bundled blog application just by saving the blog. I cant seem to understand how configure the blog's save.php to enable sending of saved blogs.
Any asistance will be appreciated. Thanks
You do not need to touch save.php. Register an event handler for 'create','object'. In your callback function check to see if the object is of subtype blog and notify_user()
thank Ismayil, let me find how to do that
Hi Ismayil, I dont seem to know what I'm doing anymore, with your advice, I created a plugin which has just the manifest file, start.php and an actions folder which has sendmail.php.
my start.php looks like this:
<?php
//register event handler
elgg_register_event_handler('publish','blog','check_for_newBlog');
//call back function
function check_for_newBlog()
{
//register action
$action_path = elgg_get_plugins_path() . 'elgg_mass_mailer/actions/';
elgg_register_action('blog/save', "$action_path/sendemail.php");
}
?>
my sendmail.php looks like this:
<?php
//get media agency email list
//get blog title input
$title = get_input('title');
//get name oof poster
$user = elgg_get_logged_in_user_entity();
//include the email fetch code
//require_once('lib/fetch_emails.php');
//send email
elgg_send_email(
//from
"SpeakoutNews Dove <admin@speakoutnigeria.com>" ,
//to be replaced by media agency email array
"Dozie ",
//subject
elgg_echo("title"),
//body
elgg_echo($blog->getURL()) elgg_echo("this is just a test email from") elgg_echo('$user'),
array $ params = NULL
);
?>
I installed the plugin and whenever i click 'save' the blog returns a blank page and doesnt save.
Any further ideas?
You are misunderstanding what event and event handlers are: http://docs.elgg.org/wiki/Elgg_Events
Here is the gist that demonstrates what you need to do: https://gist.github.com/hypeJunction/7004080
Hi Ismayil, thanks for your support so far. I looked at the gist u posted and made some modifications like changing the 'TO" and "from" values, modifying contents of the "body" etc and after uploading it and activating the plugin, it still doesnt send out emails, I even had to try different email providers in the "to" field and it doesnt seem to work. I decided to just copy and past ur code exactly into start.php and change only the "to" email, that also doesnt seem to work. Any further assistance will be appreciated. Thanks