Forums / Setup & design / Sending different emails after creating object

Sending different emails after creating object

Author Message

Paul Etienney

Wednesday 13 August 2008 2:48:23 am

Hi,

I am wondering how to send three different mails to three persons after creating one object.
This object is a client (he has no user account) and I would like to tell him : "Ok we are taking care of you M. Smtih". I also want to send another email to a partner "We have a new client : M. Smith, please take care of him, his number is 888 777 666".

I few ideas about the how-to but i am sure it is quite easy.

Do you have any idea ?

Thank you very much.

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Paul Etienney

Thursday 21 August 2008 2:43:48 am

Hi,

I am not sure I was really clear in my precedent message.

Here is exactly the process I want to build :

1 : A user create a new object. This object is a new client. One of the attribute of this client is his email adress.

2 : An email is sent to the client. This emails says something like : "Hello Mr. Smith we are taking care of you".

3 : An email is sent to the administrator. It says something like : "Hello Mr. Admin, a new client has been created. His name is Smith"

I guess the notification options is not what I want.
Do you have an idea ?

Thank you very much

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

Mark Marsiglio

Thursday 21 August 2008 4:36:18 am

The default behavior of the /user/register module sounds just like what you need.

1) A new visitor goes to /user/register and completes the form, which creates a new user object.
2) The new user receives a confirmation email to verify the email address, and clicks on the link
3) Another email is sent to the user with their username, password, and link to their profile
4) The AdminEmail (in site.ini) receives an email about the fact that a new users was created, and a link to their profile. Admins could click on the profile to see the phone number, or you could modify the email template to include that (you would also need to have a new phone number attribute in your Client class)

This should be the case with only a few modifications from a default ezwebin installation in settings, as long as your Client class has a user account. The settings that need to be changed are related to default user class and default user group ID.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Paul Etienney

Thursday 21 August 2008 4:57:40 am

Thank you Mark.

The problem is that the new object is a client but do not have a user account. He will never visit the extranet.
Actually I need to send 3 different emails.

-- Good websites creation --
My site : http://www.pauletienney.com
Twitter : http://www.twitter.com/p_etienney

André R.

Thursday 21 August 2008 5:34:03 am

One option would be eZContentObjectEditHandler:
http://serwatka.net/blog/ez_publish_3_8_new_custom_edit_handler

Note that the structure of the functions have changed a bit in 4.0:

    function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage  )
    {
    }
 
    static function storeActionList()
    {
        return array();
    }
 
    function publish( $contentObjectID, $contentObjectVersion )
    {
        return true;
    }

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom