Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: send a mail after saving !!

send a mail after saving !! 04 Jul 2013 17:47 #7868

  • pinochet
  • pinochet's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Karma: 0
if I send mails, but they can give me a hint on how to get the data you saved to send??
I've tried using Jdom like the view but does not work says: Body empty data
Any idea?
$body = $result['nombre_propiedad'];
$body =<?php echo JDom::_('html.fly', array(
						'dataKey' => 'nombre_propiedad',
						'dataObject' => $row,
						'route' => array('view' => 'propiedadesitem','layout' => 'propiedadesitem','cid[]' => $row->id)
					));?>
The administrator has disabled public write access.

send a mail after saving !! 04 Jul 2013 19:47 #7872

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
I can see an error in your code :
Remove
<?php echo
?>
$body = JDom::_(
...
);

Did you got it to select and treat your datas ?
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: pinochet

send a mail after saving !! 04 Jul 2013 21:58 #7876

  • pinochet
  • pinochet's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Karma: 0
Empy says Body again, that might be??? please help me, I'm almost done with the hair on my head
The administrator has disabled public write access.

send a mail after saving !! 19 Aug 2013 22:00 #10853

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Did you got it ?
Coding is now a piece of cake
The administrator has disabled public write access.

send a mail after saving !! 19 Aug 2013 22:07 #10857

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
There is a difference between two situations :
Is it new data, or data already in database?
If it is new data, then use something like
$body. =$data['the_field '] 
If it's data already stored, use jDom or use a query to get the data you need
Last Edit: 19 Aug 2013 22:10 by VeCrea.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

send a mail after saving !! 19 Aug 2013 22:15 #10858

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
@VeCrea : not clear.

This post is starting to be a mess. I do not understand the source of anybody.

@pinochet :
I can see you are struggling.
Don't worry. This functionality will pop up soon I think.

If you can wait a little bit, I will integrate it in a very simple mode :
- When a new item is created NOT by a user without ACL 'core.edit.state'... So publish = 0
- Mean that the item is waiting for approval => sending mail to system admin

It will not integrate more features for the moment. In order to keep it simple.
Let me just finish to answer all the missed topics (soon finished)
Coding is now a piece of cake
The administrator has disabled public write access.

Re: send a mail after saving !! 11 Jul 2015 22:24 #13321

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
Any idea how far away you are from this dev being available? :) Just checking.
The administrator has disabled public write access.

Re: send a mail after saving !! 11 Jul 2015 22:39 #13322

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
What do you need? Explain and I'll help.
The administrator has disabled public write access.

Re: send a mail after saving !! 12 Jul 2015 00:47 #13323

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
Ok here we go. :)

I have a table and view called moderators in my component which I can load users into that are in the end the people who get emailed anytime an update is done. So basically I want to be able to place a call to a mail script from anyone of my views when an event is submitted to the list of users in the moderator table.

Hope that makes sense?
The administrator has disabled public write access.

Re: send a mail after saving !! 12 Jul 2015 18:16 #13330

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
Yeah,

Fork the controller for the item from the table you want to mail updates, lets call the table "events".
So, create in your fork folder a subfolder "controllers". Copy the event.php (not events.php!) from the _fork/controllers folder which is generated.

Now, open the admin/controllers/event.php and copy/paste the function "save" into your forked event.php. When you want to have a mail when an event is inserted or another data manipulation, just copy those functions too (add/delete).

In your forked event.php, create a function MailModerators or whatever you need and create the code to mail the moderators in there (assuming you know how)
Then, call that function in the save function just after $result = parent::save();

Similar to the add() function.
The administrator has disabled public write access.
The following user(s) said Thank You: jonathanbell
  • Page:
  • 1
  • 2
Time to create page: 0.106 seconds

Get Started