6 Replies Latest reply on Feb 10, 2016 6:31 AM by Ryan Rutan

    How to add additional user info to message template?

    kswallow

      Hi, I'm trying to add additional user info to the "Invite Others to Group" message template. Right now, only the inviter's name with link to profile shows up. We'd like to add other fields such as email address, phone, title. How can this be done in the message template code? Below is the code for reference:

       

      ${customHtml}

       

      <#if newUser>

      <hr noshade size="1" color="#dddddd" />

       

      <p>

      You've been invited to join: ${container.name}. To register and complete a short profile, <a href="${newUserValidationLink}" ${newUserValidationKey}>click here.</a></p>

       

      After registration, you'll be able to access the group <a href="${containerUrl}" ${containerUrl}>here</a> anytime.</p>

       

      <#else>

      <p>Follow this link to join:</p>

      <p><strong><img src="${jiveURL}/images/jive-icon-groups-16x16.gif" border="0" valign="middle" alt="" height="16" width="16" style='padding-top: 3px'/><a href="${containerUrl}">${containerUrl}</a></strong></p></#if>

       

      <p>

      Thanks!

      </p>

      <p>

          <strong><img src="${jiveURL}/images/jive-icon-profile-16x16.gif" border="0" valign="middle" alt="" height="16" width="16" style='padding-top: 3px'/> <a href="${JiveResourceResolver.getJiveObjectEmailURL(user, true)}">${SkinUtils.getDisplayName(user)}</a></strong>

      </p>

        • Re: How to add additional user info to message template?

          Rashed Talukder - thought you might be able to help Kevin here?

              • Re: How to add additional user info to message template?
                Ryan Rutan

                Message templates are not per-say part of the developer platform, but more of an advanced configuration.

                 

                When looking at the message instructions, we see:

                 

                Name:Invite Others to Group
                Description:This email template is appended to the editable template when a user invites others to a social group
                Instructions:Message templates can be customized using Freemarker syntax and the classes available in the Jive API. The subject input field is a text box instead of a text field so that you can inject code to customize the subject line of the message template. The majority of your templates will probably have a single line in the subject text box.

                 

                The following tokens may be used as part of this email:

                 

                ${customText} ${newUser} ${newUserValidationLink} ${newUserValidationKey} ${inviterName} ${invitee} ${containerUrl} ${communityName} ${instanceURL} Additionally, the following full object is available:

                 

                ${user}

                 

                They only object available to you would be ${user}, and you could check fields such as these:

                Jive API (5.0.0.0) Core Javadocs  (Granted this is an older version of Jive)...but for the most part you can see a lot of the core fields.

                 

                ${user.firstName} or ${user.name} ... ${user.email} should all be valid tokens.  Unfortunately, the only way to get the Profile fields is to have a static helper method that can be referenced in the freemarker runtime, but I dont have those details at ready hand at the moment.  This means that fields like Company, Title etc... may be difficult / not possible to get without some extra non-template work.

                 

                Does that help?

                  • Re: How to add additional user info to message template?
                    kswallow

                    Thanks, Ryan. I clicked through on that link but not sure really where to find the list of tokens that can be used. I tried a few tests with no success when adding in things like:

                     

                    ${user.email}

                    ${user.mobile}

                    ${user.title}

                     

                    to the bottom of the email template. But then again, I'm not a developer so could be doing it wrong. If you have any more direction on this or which section of that documentation I should review that would be helpful.

                     

                    Thanks,
                    Kevin

                      • Re: How to add additional user info to message template?
                        kswallow

                        Hi Ryan,

                         

                        The token for email is working: ${user.email} and pulls in the email address in the message template. But, I cannot find the token for mobile phone or a list containing all tokens. There is no way to search the above manual. Do you happen to know what mobile phone token would be or can you point me to a list of tokens or somewhere I could find it? I've done a variety of Google searches and searches in the JC with no luck. Thanks in advance.

                         

                        -Kevin

                          • Re: How to add additional user info to message template?
                            Ryan Rutan

                            Kevin, please see my last comment =)

                            ${user.firstName} or ${user.name} ... ${user.email} should all be valid tokens.  Unfortunately, the only way to get the Profile fields is to have a static helper method that can be referenced in the freemarker runtime, but I dont have those details at ready hand at the moment.  This means that fields like Company, Title etc... may be difficult / not possible to get without some extra non-template work.

                            Title, Mobile Number are extended profile fields and will not be available without some extra work.  As for the link, it looks like I didn't send the inner-frame link I intended.

                            User (Jive API (5.0.0.0) Core Javadocs)

                             

                            If you notice on this page, there are methods like getName(), getFirstName(), getEmail() ... these line up to the bean spec that Freemarker uses, for user.name, user.firstName, user.email.  Also, without some help from a static Java Class (which I did a quick search and didn't see anything in the code base that you could leverage) , or a product customization, you will not be able to pull in any additional fields into this template.  =\

                             

                            Does that help explain the situation?