eZ Community » Forums » General » Sending Emails on Approval / Rejection
expandshrink

Sending Emails on Approval / Rejection

Sending Emails on Approval / Rejection

Tuesday 21 September 2010 5:25:53 pm - 13 replies

I am looking to setup a system in which a user registration needs approval. I think that can be easily achieved by workflow mechanism (Event / Approval and Multiplexer).

What is best way to set or tweak the system where it can send emails to the user once approved or rejected by the approver/administrator.

I am using 4.0.1.. I read somewhere that it is possible in 4.2.0. Please suggest...

Much appreciated.

Modified on Tuesday 21 September 2010 6:25:27 pm by John Smith

Wednesday 22 September 2010 5:15:20 pm

Anybody please???

Wednesday 22 September 2010 5:30:21 pm

Hi John,

This currently isn't possible as far as I know. When running the user/register process an email will be sent to the user requiring activation irregardless of the event/approval workflow. Unfortunately this actually incurs further problems in that the user/activate script then logs you in automatically - but an unpublished user (unpublished because they are still unapproved in the workflow) does not have any permissions, including anon permissions, so they will see access denied messages for the entire site.

The only workaround appears to be removing the email approval process and modifying or copying the event approval process to send out the email at the end of the process.

I filed a bug about this a month ago http://issues.ez.no/IssueView.php?Id=17145

I haven't tested this against 4.3 or 4.4 to see if was already fixed.

Wednesday 22 September 2010 6:01:51 pm

Hi,

I do not have any suggest.

But i'm wondring, if user registration means that a content object will be created using the content class user. Why a simple workflow will not work, like all others content classes ?

TKs

Wednesday 22 September 2010 6:29:41 pm

Cheers guys....

@Andrew: I am aware of that problem... Easy way to hack /user/register.php by commenting $user->loginCurrent(); after "Publish" action.

@Abdelkader: Yes, simple workflow works but the problem is to fire emails while approval/denial of the user by the administrator.... Can not find the easy way out....

One more thing, does the system fire any email on content approval/rejections to the creator after the creator added the item to the notifications.

Lets say I am the registered user on the website... I publish some news article which goes to administrator for checking.... Now depending on administrator's action in the "My account-> Collaboration" does the system send any emails to the creator?

Wednesday 22 September 2010 7:47:41 pm

Idea / Question:

Can't you make a Content Edit Handler? Where you check if the current published object is a user, and then do all the logic there? You can set the user to deactivated and so on..

And then you can generate a link to the administrator like the one the system normally sends to the user, where you create a link the admin can click, and the link can go to your own module, where you can approve/reject?

EDIT:

You can make your own "VerifyUserType".

Check site.ini, somewhere around line 470. Read the comments.

I have done this once (just like you describe), and I remember now, that this is how I did it...

Modified on Wednesday 22 September 2010 7:55:44 pm by Håvard Bergersen

Wednesday 22 September 2010 8:18:21 pm

You could add a group with with more permissions than the standard 'members' group. On user registration you than publish the user with a hidden node to the second group. The moderator then gets a mail to approve or reject the membership. Let me know if you need the code to do this.

Wednesday 22 September 2010 9:16:39 pm

I don't think you will achieve what you want with the default approve event type.

Why not copy the event type to a new one in your extension and add code to send an email on the approval or rejection of the process?

You can insert a mail event into checkApproveCollaboration in your custom eventtype prior to returning the status. This will then be picked up and processed by the eventtype and an email send after the approver has chosen approve or deny.

Wednesday 22 September 2010 10:20:17 pm

Thanks all for kind support.

@Sebastiaan: Worth checking the code and the logic if you do not mind sending the code please. Can be useful for another requirement.

@Andrew: To be honest, not an expert in developing the extensions. It would be a great help if you can guide me little bit more. Is there any contribution which I can follow?

Also this means, if I leave the member approval requirement a side, it is not possible to fire any email on content approval/rejections to the creator after the creator added the item to the notifications?

Modified on Wednesday 22 September 2010 10:23:14 pm by John Smith

Thursday 23 September 2010 12:15:16 pm

Hi John,

I'd go the way Håvard suggested : VerifyUserType. More information on the following threads :

Let us know how things go,
Cheers,

Thursday 23 September 2010 12:32:59 pm

Thanks Nicolas, few links you suggested are my own post.

What about the link below. Will it work for simple email notification when the content is approved / denied by the approver/adminsitrator.

http://share.ez.no/forums/install-configuration/workflow-notification

I checked the code, can not find any if($approve) on line 275. If this works, that will save my life...

Anybody tested?

Cheers,

Friday 24 September 2010 5:24:48 pm

Any body on the following link?

http://share.ez.no/forums/install-configuration/workflow-notification

Monday 27 September 2010 7:40:44 pm

I just asked for a little precision there. You may want to participate to the thread too !

Cheers,

Monday 04 October 2010 4:06:16 pm

I just asked for a little precision there. You may want to participate to the thread too !

Cheers,

Still no reply from Gaetano Giunta.....

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from