SuiteCRM Survey question

Hello all

We are using the SuiteCRM survey module to send a survey by mail automtically everytime a meeting is set to “Held” to the account/contact related to this meeting.

What we do is an after_save logic_hook just to send the link of the survey by mail. However I would like to know if there is any way to identify the account that has replied to this survey, like sending a hiding parameter in the link of the survey, so that later on we can use to identify which account has answered the survey.

Thanks a lot!

Hi @jlabuelo, welcome back!

Could you maybe have an after_safe logic hook on the survey module which once called then updates the account with matching name etc etc?

@pgr any better ideas?

I don’0t know this very well, but I think the Surveys has a mode where you send the survey from a Campaign. I would go see how this is done there and emulate the same thing. I am pretty certain the mechanism is already there to include tracking info in the URL.

Hello Mac-Rae and Pgr.
Thanks a lot for your answers however dont see how to implemente what we need exactly with your suggestions.

What we do is, automatically with a meeting after_save hook, send an email that includes the public link of the survey created in SuiteCRM. The customer (Account/Contact) recevies the mail and by clicking in the link they fullfil the survey with their answers.

First suggestion from Mac-Rae would be a great solution, the problem is how to get the Account/Contact identifier to relate the survey answers with that identifier. The email gets to the customer but they access to the Survey in "public"mode, they do not need to use any login/password… etc… and I dont want to ask them to introduce their mail address, name…

Second option explained by Pgr it could be an option, problem here is how to do this “automatically”. I have readed the documentation, and see that I can create a Campaign of type “Survey” and once the mail is sent to the customer, SuiteCRM will link the Account/Contact to the answers… but problem here is that I would have to create the Target List manually everyday, and send the campaign mails manually everyday also. What we try to do is to send the mail right after the agent closes the meeting as “held” in SuiteCRM so the customer has the answers fresh.

Sure there is no way to introduce a parameter/identifier somehow in the public link of the survey that is sent to the Account/Contact by mail, and then save that identifier as a field in the survey response?

Cheers

When you send the Survey from a Campaign, what does the URL included in the email look like? It likely has some extra parameters there. That’s what you could try emulating by yourself, without sending the survey from a campaign.

It might be simple, this just resurfaced from my memory…

just add &contact=$contact_id to the URL
e.g.

$sugarurl/index.php?entryPoint=survey&id=theguidofyoursurveyhere&contact=$contact_id
1 Like

Great Simon, Thanks a lot

If I want to relate it with an account could I do it this way? (or it does only work with contacts)

&account=$account_id

I have tried and I see the responses in the surveyresponse table, … but field “account_id” is empty

I believe it has to be contact however you could use a workflow to create a relationship depending on the contents of the survey ie the account name

Perfect, I have changed the code to include the “contact_id” and now it works great!
Thanks so much!

1 Like

Hello jlabuelo, How did you change the code to include contact_id into accounts module please

Hello, sorry for the late response. Just need to follow simon suggestion. At the end of the survey url, in the code you need to add the value of the contact_id of the contact you want to send the survey to.

It will be something like $newURL = $oldURL."&contact=".$contact_id;

Hope it helps