No announcement yet.

After upgrade Email sending does not work

  • Filter
  • Time
  • Show
Clear All
new posts

  • After upgrade Email sending does not work

    I haven't long time EspoCRM upgraded and after latest patch I discovered that E-mail sending not work any more, throws out validation error.
    in entityDefs:

    "status": {
    "type": "enum",
    "options": ["Draft", "Sending", "Sent", "Archived", "Failed"],
    "default": "Archived",
    "clientReadOnly": true,
    "style": {
    "Draft": "warning",
    "Failed": "danger",
    "Sending": "warning"
    "customizationDisabled": true

    In logs:
    [2023-08-28 07:52:13] DEBUG: API (400) validationFailure; POST /Email; Input data: {"isRead":true,"isImportant":false,"inTrash":fa lse ,"isUsers":false,"isHtml":true,"status":"Sendin g", "isSystem":false,"isJustSent":false,"assignedU sers Ids":["1"],"assignedUsersNames":{"1":"XXX"},"teamsIds":["5494a63b986cc"],"teamsNames":{"5494a63b986cc":"XXX"},"body":"test <br>","from":"","to":"","cc":" ","bcc":"" ,"parentType":null,"parentName":null,"parentId" :nu ll,"selectTemplateName":null,"selectTemplateId":n u ll,"subject":"test","name":"test","bodyPlain":"te s t\n","attachmentsIds":[]}; Route pattern: /{controller}; Route params: Array ( [controller] => Email [action] => create )
    [2023-08-28 07:52:13] WARNING: (400) Field validation failure; entityType: Email, field: status, type: valid.; POST /Email; line: 56, file: /var/www/vhosts/XXX/YYY/application/Espo/Core/Exceptions/BadRequest.php​

    What is wrong? How i can get email sending back to work.

    Click image for larger version  Name:	image.png Views:	0 Size:	107.4 KB ID:	96880
    Last edited by markopraakli; 08-28-2023, 07:58 AM.

  • #2
    Maybe you have in a custom entityDefs for Email.


    • #3
      No i don't totally untouched Email fields and definitions.
      Any other ideas what to check?


      • #4
        This error occurs when the status value passed to API is other than one of values defined in entityDefs options as you might have figured out. I have no idea how this can happen assuming the value "Sending" is passed and ["Draft", "Sending", "Sent", "Archived", "Failed"] is the actual option list.

        You can check the actual options for the field in data/cache/application/metadata.php


        • #5
          Originally posted by yuri View Post
          You can check the actual options for the field in data/cache/application/metadata.php
          'status' => [
          'type' => 'enum',
          'options' => [
          0 => 'Draft',
          1 => 'Sending',
          2 => 'Sent',
          3 => 'Archived'
          'default' => 'Sisse tulnud',
          'clientReadOnly' => true,
          'style' => [
          'Draft' => 'warning',
          'Failed' => 'danger',
          'Sending' => 'warning'
          'customizationDisabled' => true,
          'validationList' => [],
          'mandatoryValidationList' => [],
          'readOnly' => true,
          'required' => false,
          'isSorted' => false,
          'audited' => false

          'status' => [
          'type' => 'enum',
          'options' => [
          0 => 'Pending',
          1 => 'Sent',
          2 => 'Failed',
          3 => 'Sending'
          'readOnly' => true

          So seems like everything exists.


          • #6
            hey markopraakli

            Notice that you have a default status as ('default' => 'Sisse tulnud') i think this is what is causing you the issue, for some reason. that needs to be fixed, you might need to check the custom folder and see what changes have you done on email.


            • #7
              @rabii​ thank you for your reply. The name "Sisse tulnud" means Inbox in Estonian, but i think that is not the case. Emails are coming in but unable to send them out. Also the TEST E-mail sending also works well.


              • #8
                It's 100% the case. Somehow you managed to edit the default value by setting the wrong one. It might have happened in the past when it was possible to do it via the UI (not sure if it ever was possible). You need to edit your custom file entityDefs/Email.json and remove the default value.