
-
Display Namejbaranello
-
Member SinceNovember 25th, 2012
-
Last SeenFebruary 4th, 2016
jbaranello does not have any add-ons for sale.
-
Support November 27th, 2012 @ 9:53 pm
Hi,
I am having a lil trouble with finding the correct syntax for a few items. In order to use your getMembers() function, what are the requirements?? Does it need to be called as follows getMembers(SecurityGrpName)??
Essentially this is my plan:
1 - Create New Variable in vardef and vardef.ext in /modules/Project and /custom/modules/Project/Ext/Vardefs respectively using the following definition:
'grp_email_list' => array ( 'name' => 'grp_email_list', 'vname' => 'Security Group E-Mail List', 'type' => 'function', 'source' => 'non-db', 'function_name' => 'get_grp_emails', 'function_params' => "Variable in Project Object for Group Names" 'function_params_source' => 'this', 'function_require' => 'custom/Extension/modules/Project/Ext/GetGrpEmails.php',
Still not too sure about how to use the 'function_params', I am assuming its like specifying input variables for the function to use, is this correct?? Which variable would I use to get the array of security group names related the project??
Also would I just stick this definition anywhere in the vardef files??
2 - Create Function in GetGrpEmail.php
This is what I have so far, not to sure if syntax is right or if it is right at all lol. Maybe you could give a look. The only thing I haven't accounted for is if there will be duplicate names (users in more then one group assigned to project).
<?php // Function to get and reformat Security Group Member Emails function get_grp_emails($grp_name_array) { // Define Empty Array and String Variable $user_array[] = array(); $vStringEmails = ""; //Get List of Users for All Assigned Secuity Groups and Append to Array foreach($grp_name_array as $val) { $user_array[] = getMembers($val); // Not sure if this will work if $val is an array, can you // confirm?? I read that this is the correct syntax if you just want // to append one item at a time to end of array. } //Get Email for Every User in $user_array and Store in Appropriate Format foreach($user_array as $val) { // Initialize Variable $user_email = ""; // Get User Email from Bean Variables $user_email = // Not to sure how to get those?? Couldn't find anything online. // Append to String to Use in Ditribution List $vStringEmails = $vStringEmails . $user_email; $vStringEmails = $vStringEmails . ","; } return ($vStringEmails); } ?>This is what I have so far. Once I am finished coding these I will attempt to add a custom field using Studio.
Thank in advance for your help.
Jason
View Comment
-
Support November 26th, 2012 @ 6:33 pm
OK cool, I'll give the link a look and see if I can implement. I'll keep you posted.
Thanks
View Comment
-
Support November 26th, 2012 @ 6:11 pm
Im comfortable with code in general lol just haven't really had any experiance doing coding with SugarCRM. Thing is I don't know how I would get the emails to be inserted into workflow. The only supported way is what I described to you, write the bean variable directly in the "To:" field. An example of what I used in the Subject line is as follows:
${bean->name} project has been modified. Where ${bean->name} displays the name of the project that was modified.
I have a feeling the variable you insert in the "To:" field will just need to be a string with the email addresses seperated with a "," and that should be ok. The only issue I have is how to get the bean variables I NEED to load with the Project Object as those are the variables i have access to when this modify_event occurs.
View Comment
-
Support November 26th, 2012 @ 5:33 pm
Hey,
Thanks for the quick response. I don't think I asked the question right. In the workflow manager there is a section that asks you to supply the recipients of the emai. In workflow manager it is possible to call on bean variables directly in the textbox where you put the distribution list. I was just wondering what would the bean variable be to call in order to get the email addresses of the users that are part of the security group. Keep in mind this email is generated when a modify event takes place on a project. Thus the bean variables for that project object are available to use. Is there any variable/variables I can use to accomplish this??
Thanks
View Comment
jbaranello has not rated any add-ons.
jbaranello has not verified any add-ons.
jbaranello has not created any Wanted Add-ons.