[SOLVED] Not receiving invitation email in local

I setup Squidex in local using the docker-compose file provided by Squidex. I added my SQUIDEX_GOOGLECLIENT with client id and SQUIDEX_GOOGLESECRET with client secret from https://console.developers.google.com/apis in my .env file.

Then I restarted the docker-compose, and add a new contributor with an email address. But I did not receive any email.

Is this happening because I ran an application in my local?

I checked into the mongo database, and found this

"Claim" :[{ "Type" : "urn:squidex:invited", "Value" : "True" }]

Environment

  • [x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [squidex/squidex:dev]

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

You need to setup an email server to get emails.

Where should I add this configuration if I am using docker-compose file for running Squidex locally?

Please read this: https://docs.squidex.io/01-getting-started/installation/configuration

1 Like

I have added the following variables to my .env file

EMAIL__SMTP__SERVER=smtp.gmail.com
EMAIL__SMTP__SENDER=myemail@gmail.com
EMAIL__SMTP__USERNAME=myemail@gmail.com
EMAIL__SMTP__PASSWORD=myP@ssword
EMAIL__SMTP__ENABLESSL=true
EMAIL__SMTP__PORT=587

Still I am not able to receive invitation email.

Is there something in the logs?

I can only see the log of POST request for contributors, there is no logs for email.

squidex_squidex_1        |  "web": {
squidex_squidex_1        |     "requestId": "|2356c040-4bb13247f34dc442.",
squidex_squidex_1        |     "requestPath": "/api/apps/gwell-test/contributors",
squidex_squidex_1        |     "requestMethod": "POST"
squidex_squidex_1        |   },

FYI I have deleted the email from contributors list and again add it to contributors list.

Can you have a look to the administration section? There is a menu item with event consumers and you should see and entry with “Invite” or so. If there is a bug icon it has failed.

Sorry for the late response, but these are the available consumers: https://prnt.sc/t66ocf

I couldn’t see an entry with “invite” and there is no bug icon as well.

It is NotificationEmailSender, sorry.

Is there nothing in the logs with SendNotification?

I can see logs for “NotificationEmailSender”

squidex_squidex_1        | {
squidex_squidex_1        |   "logLevel": "Information",
squidex_squidex_1        |   "action": "HandleEvent",
squidex_squidex_1        |   "actionId": "db323aae-36c9-4900-97eb-fb3c0baccc45",
squidex_squidex_1        |   "status": "Completed",
squidex_squidex_1        |   "eventId": "db323aae-36c9-4900-97eb-fb3c0baccc45",
squidex_squidex_1        |   "eventType": "AppContributorAssigned",
squidex_squidex_1        |   "eventConsumer": "NotificationEmailSender",
squidex_squidex_1        |   "elapsedMs": 0,
squidex_squidex_1        |   "app": {
squidex_squidex_1        |     "name": "Squidex",
squidex_squidex_1        |     "version": "4.0.0.0",
squidex_squidex_1        |     "sessionId": "d1d483e8-ddde-4890-893d-63fbc0d1ff20"
squidex_squidex_1        |   },
squidex_squidex_1        |   "timestamp": "2020-06-25T10:24:19Z"
squidex_squidex_1        | }

It’s status is completed, but I haven’t received any email.

Can you just send me the full log file for the complete application execution? Restart squidex, invite a user and then send me the logs

Please find the log file here.

Something is not correct with your deployment:

squidex_squidex_1        |     "email:smtp:enablessl": "True",
squidex_squidex_1        |     "email:smtp:password": "",
squidex_squidex_1        |     "email:smtp:port": "587",
squidex_squidex_1        |     "email:smtp:sender": "hello@squidex.io",
squidex_squidex_1        |     "email:smtp:server": "",
squidex_squidex_1        |     "email:smtp:username": "",

Just putting it to the .env file does not work. The .env file is like set of variables for docker.

You have to map them to concrete environment variables then

e.g.

    environment:
      - URLS__BASEURL=${SQUIDEX_PROTOCOL}://${SQUIDEX_DOMAIN}/

But you just add them to the dockerfile directly

1 Like

Oh sorry my bad, I forgot to map environment variables in docker-compose file. Not I am getting the bug icon with message.

System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Authentication Required. Learn more at
   at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
   at System.Net.Mail.MailCommand.EndSend(IAsyncResult result)
   at System.Net.Mail.SendMailAsyncResult.SendMailFromCompleted(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
   at System.Net.Mail.SendMailAsyncResult.End(IAsyncResult result)
   at System.Net.Mail.SmtpClient.SendMailCallback(IAsyncResult result)
--- End of stack trace from previous location where exception was thrown ---
   at Squidex.Infrastructure.Email.SmtpEmailSender.SendAsync(String recipient, String subject, String body) in /src/src/Squidex.Infrastructure/Email/SmtpEmailSender.cs:line 75
   at Squidex.Domain.Apps.Entities.Apps.Notifications.NotificationEmailSender.SendEmailAsync(String template, String emailSubj, String emailBody, IUser user, TemplatesVars vars) in /src/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs:line 128
   at Squidex.Domain.Apps.Entities.Apps.Invitation.InvitationEventConsumer.On(Envelope`1 event) in /src/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs:line 109
   at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.DispatchConsumerAsync(Envelope`1 event) in /src/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 258
   at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.<>c__DisplayClass15_0.<<OnEventAsync>b__0>d.MoveNext() in /src/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 96
--- End of stack trace from previous location where exception was thrown ---
   at Squidex.Infrastructure.EventSourcing.Grains.EventConsumerGrain.DoAndUpdateStateAsync(Func`1 action, String caller) in /src/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerGrain.cs:line 213

There is another thread about google smtp. You should be able to find the correct setup in the forum.

I did check this thread: User invitation emails not sending, and have all the configuration params same as well. But the thread ended in the middle of the conversation.

Also the error message from the consumer is also different.

just enabling the less secure apps from https://www.google.com/settings/security/lesssecureapps, solved the problem. Thank @Sebastian for your support.

1 Like