21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 184 Views |
-
Email on alteration to dataobject in CMS?

2 November 2011 at 4:13pm
Hi, guys.
Question: is it possible to have SS send an email to an email address stored in a particular DataObject when that DataObject is altered and then saved in the CMS?
-
Re: Email on alteration to dataobject in CMS?

2 November 2011 at 9:17pm
class MyDO extends DataObject {
function onBeforeWrite() {
parent::onBeforeWrite();
$email = new Email();
$email->sendPlain();
}
} -
Re: Email on alteration to dataobject in CMS?

3 November 2011 at 7:51pm
Thanks!
Further refinement: is it possible to have it send that email only when a certain specific database field is changed?
-
Re: Email on alteration to dataobject in CMS?

3 November 2011 at 11:39pm
yes, check out this method...
http://api.silverstripe.org/2.3/sapphire/model/DataObject.html#methodgetChangedFields
| 184 Views | ||
|
Page:
1
|
Go to Top |



