Case Creation Email Problems

So I’ve been doing a bit of testing with the case creation emails. I’ve pretty much got AOP working properly and cases get created from emails properly. However, the auto reply template has problems.

First, there are TWO places you need to set this. One in the intbound email account:

AND In AOP (I can’t understand why you have to enter it in two places):

I’ve just done extensive testing on this and here’s what I’ve found:

  1. You have to the email template in BOTH places or it will not send the email at all.
  2. The email sent from the inbound email selection does not populate the variables in the email template at all.
  3. The email template selected in the AOP settings does populate the email variables properly.
  4. BOTH emails are sent every time.
  5. I have experimented with one of them being set to “none” and no emails are sent at all.

So, is it just me, are others experiencing this? Should I add a bug on Github? Does anyone have a solution?

As a work around what I did was create two email templates. One that has no variables and basically just says “thank you”. I use that as the template in the inbound email settings. I use the regular case creation template in the AOP settings. The client still gets two emails, but it at least they look like they were meant to be that way.

Hey,

Hmmm, interesting, I’m not experiencing that myself

I’ve set it up similarly:
image

And receive an Email using the Template set in Admin->AOP Settings
image


Do you by chance have any Contact records with the same email Address as the Sender of the Email?

I believe the AOP functionality does the following:

  • Create Case
  • Search through Contacts, if there is a matching Email address, relate the Contact (and the Contact’s Account) to the Case
  • Send the appropriate Email (In this instance, “Case Creation”

So if there’s no Contacts, it won’t send the AOP Email out


Although, I agree that it can be misleading, especially as the “New Case Auto-Reply Template” seems to parse differently to the AOP Email
(Which, in itself, may be worth raising on Github)

1 Like

Thanks John, if there’ s light at the end of the tunnel, I’ll do some more testing then and try and get to the bottom of it. I went through a bunch of posts on here last night and seems lots of people having issues with it sending the emails and/or creating the cases. Hopefully, I can get to the bottom of it! If so, I’ll document the proper procedure here. Thanks again for testing on your end.

1 Like

OK so when I only have the template selected in the AOP settings, I get…

Fri Nov 13 14:38:46 2020 [32634][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:38:46 2020 [32634][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:38:46 2020 [32634][1][ERROR] ImapHandler trying to use a non valid resource stream.
Fri Nov 13 14:38:46 2020 [32634][1][ERROR] ImapHandler trying to use a non valid resource stream.
Fri Nov 13 14:38:47 2020 [32634][1][ERROR] convert: Conversion of 11/13/2020 03:00pm from Y-m-d H:i:s to m/d/Y h:ia failed
Fri Nov 13 14:39:28 2020 [32657][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:39:28 2020 [32657][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:39:28 2020 [32657][1][ERROR] ImapHandler trying to use a non valid resource stream.
Fri Nov 13 14:39:28 2020 [32657][1][ERROR] ImapHandler trying to use a non valid resource stream.
Fri Nov 13 14:39:34 2020 [32657][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:39:34 2020 [32657][1][ERROR] Unable to find relationship emails_email_templates
Fri Nov 13 14:39:34 2020 [32657][1][ERROR] ImapHandler trying to use a non valid resource stream.
Fri Nov 13 14:39:34 2020 [32657][1][ERROR] ImapHandler trying to use a non valid resource stream.

Ok so I created the relationship between emails and email_templates and now it works. I don’t know why I would be missing that. Anyway, it now works with only the template defined in AOP settings…so for anyone else running into getting two emails sent on case creation or an email sent that has none of the variables filled in…

  1. Do not define the case email template in the inbound email settings.
  2. If you’re testing make sure you have a contact created with your testing email.
  3. Define your case creation email template only in AOP settings in Admin ONLY.
1 Like

Hey,

Oddly, I’m also seeing similar Error Messages if I turn Logging to “ERROR”
image

Despite it working for me

Normally the CRM should work fine, where only FATAL errors would break functionality, but I’m glad to hear you were able to resolve it


Just for curiosity’s sake, is your CRM an upgrade from a previous version, or a fresh install?
What version are you on now? (and came from, if upgraded)

I was testing on a fresh 7.11.18

I’m on 7.11.15, I’ve been using SuiteCRM since the beginning, this installation was originally Sugar CE, so I’ve updated dozens of times over the course of this installation over many years.

After I created the relationship, I’m still getting that error message, but somehow it seems to work now with only the template selected in the AOP settings after I added the relationship and rebuilt the relationships in Repair. All variables are being populated correctly, so I’ve got it 100% working. Kind of weird, but anyway it’s working. Thanks so much for pointing me in the right direction! I think I’ll do a Youtube video on setting all this up and post it for the community this weekend. Seems there are a lot of threads of people struggling to get this working.

2 Likes

Good Morning,

Thank you for your video! I’ve been trying to get this cases working for a very long time and it still doesn’t work… I’ve followed everything as per your video, Schedulers is running as it should, inbound email coming in but it it’s not creating a case from that inbound email.
Could it be the support email that is set up as the group email is a Microsoft office 365 account?

If your emails are coming in then the only other thing I can think of is your cron jobs either aren’t running or the specific job to create the cases isn’t working. Have you checked your job log and is the case creation job running without error?

1 Like

Hi PStevens,

Only saw now that you replied - didn’t get a notification :wink:
I created a gmail test email address to test my theory, and after I created an app password, everything ran smoothly - Cases got created, emails get send out on case creation, updates and closure as it should.
Then I went back to try our Office 365 mailbox again, it took a while to get the emails working, as the app passwords did not work, we ended up having to create a workaround in Azure to allow smtp on that Mailbox. Now emails are working, Group email and outbound emails
But now again it’s again not creating cases from Inbound mail,
schedulers are running as it should, cases creation workflow job is not running - I suppose Office 365 might be the problem here, but I’m all out of things to try to get this to work

Just seems odd that the emails are imported and it’s not working just with 365. My understanding of how it works is to looks for the case ID in the subject and then creates the case from the imported email, or links it to an existing case, if it already exists. If the emails are imported and the case ID is in the subject, I can’t think of any other reason why it wouldn’t work. If you’ve tested with Gmail, maybe using a gmail account for your support email might be a solution to the problem.

Is the email address you’re sending from a “contact” in SuiteCRM?

PS - I think Outlook might have a similar concept to “app passwords” if memory serves me correctly.

When the emails come in, they don’t create a Case ID in the subject, therefor obviously it’s not creating a case. I also tried the Office 365 app password, that doesn’t seem to work even to just get the emails working.
Yes the contact is created in Crm, and with gmail it works well

Guess what! Just switched to Office 365 and my case import stopped working!

It imports the email into the inbox, just doesn’t create a case from it. Was working 100% before the switch.

So I noticed a difference between the two emails:

OK anyone else having this problem I got to the bottom of it. There is a bug and a fix on Github. The issue is the character set Office 365 sends IMAP in. Anyway, there’s now a fix to accommodate. I replaced this file with the patched file, repair and rebuild and it works.

Outlook case creation fix

1 Like