Send request Odoo doesn't deliver email

172 views Asked by At

I am using OdooRPC to send sign request in Odoo.

The process consist in 4 Parts:

  1. Send the document to Sign to Odoo.
  2. Send the fields to sign in the document, can be text field type or sign field.
  3. Prepare the email template with the document and the signers (contacts from Odoo) to sign request.
  4. Send the sign request email.

The code to prepare the request is:

request_fields = {
            'template_id': template_id,
            'signer_ids': [[0, 'virtual_25', {'role_id': 2, 'partner_id': employee_id1}],
                           [0, "virtual_37", {'role_id': 3, 'partner_id': employee_id2}]],
            'signer_id': False,
            'signers_count': 2,
            'has_default_template': True,
            'is_user_signer': False,
            'follower_ids': [[6, False, []]],
            'subject': 'Sign Request',
            'filename': 'document_to_sign.pdf',
            'message_cc': '<p><br></p>',
            'attachment_ids': [[6, False, []]],
            'message': '<p>Hi.</p><p>Sign this document, no reply</p>'
        }

# Prepare email request
sign_email = self.odoo.env['sign.send.request']
email_id = sign_email.create(request_fields)

After create the email template, I can tell Odoo to send the sign request

 # Prepare email request
 sign_email = self.odoo.env['sign.send.request']
 email_id = sign_email.create(request_fields) # int type

 request_sign = sign_email.send_request(email_id)

The answer method doesn't show any error:

{'name': 'file_name.pdf', 'type': 'ir.actions.client', 'tag': 'sign.Document', 'context': {'id': 1234, 'token': 'abcd-1234-efgh-5678', 'sign_token': None, 'create_uid': 9, 'state': 'sent', 'request_item_states': {'1234': False, '1235': False}}}

The method 'send_request' create the email in Odoo, but it doesn't deliver the email to the recipents.

2

There are 2 answers

3
Sidharth Panda On

have you configured outgoing mail server in odoo which is in settings>technical>outgoing mail server if not please configure it, if yes then check in settings>technical>email if the email is sent from your side then a record will be created in it. please check it and update those information in the question in order to help you better.

0
Juan Botero On

I got the email message now. removed the 'is_user_signer' key from the request_fields dictionary.

request_fields = {
        'template_id': template_id,
        'signer_ids': [[0, 'virtual_25', {'role_id': 2, 'partner_id': employee_id1}],
                       [0, "virtual_37", {'role_id': 3, 'partner_id': employee_id2}]],
        'signer_id': False,
        'signers_count': 2,
        'has_default_template': True,
        'follower_ids': [[6, False, []]],
        'subject': 'Sign Request',
        'filename': 'document_to_sign.pdf',
        'message_cc': '<p><br></p>',
        'attachment_ids': [[6, False, []]],
        'message': '<p>Hi.</p><p>Sign this document, no reply</p>'
    }

Now, it sends email messages with the sign request.