SiT! Bugs - SiT!
View Issue Details
0000990SiT!templatespublic2009-10-22 14:592010-01-23 19:02
0000990: When creating a new email action the template dropdown is blank
When we try to create a new "email action" for a trigger, the dropdown to select the template is blank.
Select triggers and add action
Select email from the dropdown list and the template dropdown list is blank
No tags attached.
related to 0001026resolved  Bind templates to triggers 
parent of 0000983closed nicdev Trigger Not working for New Held Email 
Issue History
2009-10-22 14:59nicdevNew Issue
2009-10-22 15:00nicdevRelationship addedparent of 0000983
2009-10-22 20:54ivanStatusnew => confirmed
2009-10-23 08:28nicdevStatusconfirmed => assigned
2009-10-23 08:28nicdevAssigned To => nicdev
2009-10-23 08:38nicdevNote Added: 0002116
2009-10-23 08:54nicdevNote Added: 0002118
2009-10-23 14:12ivanTarget Version => 3.50p1
2009-10-28 12:13nblNote Added: 0002141
2009-10-28 17:04nicdevNote Added: 0002143
2009-10-29 01:44nblNote Added: 0002145
2009-11-18 21:49nicdevAssigned Tonicdev => administrator
2009-11-18 22:02nicdevAssigned Toadministrator =>
2009-12-04 19:31paulhNote Added: 0002217
2009-12-04 19:31paulhStatusassigned => feedback
2009-12-08 19:25paulhNote Added: 0002221
2009-12-08 19:25paulhStatusfeedback => confirmed
2010-01-05 14:05ivanNote Added: 0002247
2010-01-05 14:07ivanRelationship addedrelated to 0001026
2010-01-09 13:33paulhStatusconfirmed => assigned
2010-01-09 13:33paulhAssigned To => paulh
2010-01-09 15:57paulhNote Added: 0002263
2010-01-09 15:57paulhStatusassigned => resolved
2010-01-09 15:57paulhResolutionopen => fixed
2010-01-09 15:57paulhFixed in Version => Current SVN
2010-01-23 19:01ivanFixed in VersionCurrent SVN => 3.51
2010-01-23 19:02ivanNote Added: 0002322
2010-01-23 19:02ivanStatusresolved => closed

2009-10-23 08:38   
The issue here is that we can access the triggers in 2 different ways.

1. In the main SiT menu, select "Control panel" -> "System actions"
- You can only select this if you have admin permission.
- In this way you are changing any template and actions related to "system" and you can see all the templates which are of the type "system" in the database "emailtemplates".

2. The second way is to select "Control panel" -> "templates" from the SiT menu and then to select "triggers" from the top of the window.
- When you do it this way you can access the triggers/actions in a "per user way" depending on your permissions
but TAKE NOTE: when you add a new "Action" from this route, and the action type is "EMAIL" the you will only see templates in the dropdown that are of type "user" (i.e. the teplates that you created yourself, if any, and if you did not create any then you will see nothing in the dropdown list.

If you create a new email action this way and you click "save" (with an empty dropdown list" you will create a faulty action which can cause other issues as the DB entry is not filled correctly! (see bug 983)
2009-10-23 08:54   
What we need to do really is to warn the user and "not allow" to be able to click "save" when the dropdown is empty. This way we ensure a bad action cannot be created..

Any input from anyone?
2009-10-28 12:13   
Hi Nicdev,

Ok, followed your suggestion to create template via Control Panel->System Actions.
On New Held Email, click Add Action. Then Select Email from Action, under Template select Email_Held_Email_Received, click Save button.

But still don't see any template when trying to create the trigger for whoever users that I want to assign.

Tried to search Wiki on this Template thingy, but could not find something useful for me to apply. Or can you point me to any link that tell us how to create a template for "New Held Email in the Queue" so that I can notify the user I want?
2009-10-28 17:03   
Hi nbl,

Ok i want to make sure i understand .. are you trying to create your own template or are you trying to create a new action?

An action is a "do this" when "that thing" happens. What we have been discussing here is creating an "action" but what you noted before was to create a template ...

I think what you wanted was to create a template of your own and then to link that with a trigger (create an action).

Can you clarify?
2009-10-29 01:44   
Hi nicdev,

Ok, remember case 983? I wanted to create an email notification of New Held Email to notify whoever I want. But you said need to create template so that I can see it in the New Email Action to select it in the Trigger section. But no matter how I tried, still don't see the template in the drop down list after creating my own template via Control Panel->Templates.
This portion I find it hard or unfriendly to use.
2009-12-04 19:31   
Hi Chaps, sorry if I'm being dense though with the latest code I never seem to get a situation where no email templates are listed in the drop down, have I missed something or have you removed all the default templates sit ships with?

2009-12-08 19:25   
reefnerd sent me a copy of his DB and found the problem to be alot of emailtemplates are of type system when they should be of type user, not sure how this happened, need to switch back or check why they where changed

In the short term you can run

UPDATE sit_emailtemplates SET type = 'user' WHERE id IN (4,5,6,7,8,12,13,14,15,16,17,20,21,22,23)

From a SQL command line and it will set the type correctly,
2010-01-05 14:05   
For 3.x The fix Paul has found is fine. We'll commit this. But for 4.x we will be implementing some more code that introduces tighter binding between templates and triggers. An intermediate table will say which templates are intended for which triggers and we will use types to determine whether the templates are intended for system actions or notifications. This is too much work for the 3.x branch though.
2010-01-09 15:57   
r5983 resolves this in both 3.x (fresh installed and upgrades) and trunk
2010-01-23 19:02   
Fix released in v3.51 which is now available