Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No outbound accounts shown in "From" dropdown with group outbound email #5774

Closed
labcerouno opened this issue Apr 23, 2018 · 19 comments
Closed
Labels
Area: Emails Issues & PRs related to all things regarding emails & email module Priority:Critical Issues & PRs that are critical; broken core functionality, fatal errors - there are no workarounds Type:Bug Bugs within the core SuiteCRM codebase

Comments

@labcerouno
Copy link

This may seen similar to #4111 but it's not a duplicate.

Outbound email accounts are being ignored when composing an e-mail in Emails module.

Issue

The outbound group email accounts set in Admin / Outbound Email are never shown in "From" dropdown of Compose page in Emails module.

Expected Behavior

All the accounts set in Admin should appear in "From" dropdown in Compose page of Emails module for all users.

Actual Behavior

If Allow users to use this account for outgoing email was checked in Admin / Email / Email Settings, this is the only account to be shown in the From dropdown. If this box was not checked, the dropdown will not populate, it will be empty, blocking the possibility to send an e-mail.

Any account set in Admin / Email / Outbound Email will be ignored in Compose page of Emails module.

Steps to Reproduce

  1. Log in as Admin
  2. Go to Admin / Email / Outbound email
  3. Click Create Outbound Email Accounts , fill up the fields properly and save
  4. Go to Emails Module and click Compose
    5.From field won't show the account created. It might show the system account if Allow users to use this account for outgoing email was checked.

Context

This bug affects the possibility to send e-mail. In our case, the system account is only used by the IT Team and should be not used by the Sales Team. If the outbound account doesn't work, we cannot send e-mails.
Due to the break of functionality of Compose in Email module, it should be High Priority.

Your Environment

  • SuiteCRM Version used: 7.10.4
  • Browser name and version: Chrome 66.0.3359.117 (64-bits) / Firefox 59.0.2 (64-bits)
  • Environment name and version: PHP 7.0 FPM, Percona Server 5.6
  • Operating System and version: Ubuntu 17.10
@Dillon-Brown Dillon-Brown added the Area: Emails Issues & PRs related to all things regarding emails & email module label Apr 24, 2018
@global-H
Copy link

global-H commented May 9, 2018

Identical issue, show-stopper. There is some chatter that if inbound accounts are not configured, the population of the drop-down is not "triggered" somehow, but we've had no success.

Only the admin outbound account is showing for all users when composing e-mail regardless of calling module.

Not tenable, needs high priority, even a dirty mod to a php/js would help. Critical issue.

@Dillon-Brown Dillon-Brown added Type:Bug Bugs within the core SuiteCRM codebase Priority:Critical Issues & PRs that are critical; broken core functionality, fatal errors - there are no workarounds labels May 9, 2018
@pgorod
Copy link
Contributor

pgorod commented May 9, 2018

Can anyone tell us which was the last version of SuiteCRM where you know for sure that this was working well?

@Mausino
Copy link
Contributor

Mausino commented May 9, 2018

@pgorod I have same issue... my version 7.10.4

  • new things are here

2018-05-09_1401

if you create outbound email account via user-> email settings -> pop up window in user account.. it will show it in pop up window of user email setting + outbound email accounts listview

2018-05-09_1334

record 2 is created via user email settings, record 1 via admin --> outbound email accounts -> new record

but if you create outbound email account via outbound email in admin area (administration-->outbound email account --> new record) doesn't will show this outbound email address in user--> settings -> pop up window

2018-05-09_1336

if you compose email... you see only system email address 👎 as reported above

  • also you can assign the record to user... but isn't working... will show for all user outbound + also can't add role or group outbound email account

@pgorod
Copy link
Contributor

pgorod commented May 9, 2018

@Mausino thanks for that. Do you know which was the last version of SuiteCRM where this was working well?

@Mausino
Copy link
Contributor

Mausino commented May 9, 2018

@pgorod after 7.8.x never working fine... i tried this 3 or 4 times in versions 7.9 /7.10 but as everybody knows.. emails were unusable till version 7.9.8 or something liked that.... afer we as community focused on smaller email bugs...

If i look on github and write "Email" i see this

2018-05-09_1720

I don't want be negative... i love working with SuiteCRM and help with many passionate people to grow this amazing sofware.. but till time when on first place doesn't will bug fixing, it is very hard testing... because new things(features) create new problems and old are left without focus on them. I am so proud that @salesagility can fight with this big project and moved it so far 👍

@ApatheticCosmos
Copy link
Contributor

ApatheticCosmos commented May 24, 2018

pgorod,
The last time I saw outgoing email work though system accounts was 7.8, while we were still evaluating SuiteCRM. Once we switched to 7.10 it stopped working. In 7.8 we could send mail as the user (users email address as 'from') as well without having an incoming mail server set up.

I've been digging though the code for a while, and I still can't figure out where the 'from' dropdown gets populated. All I need for our use is to populate the from field with the users email address from their profile.

@pgorod
Copy link
Contributor

pgorod commented May 24, 2018

I think user accounts are getting saved around here
https://github.com/salesagility/SuiteCRM/blob/master/modules/InboundEmail/InboundEmail.php#L2739

And the populate the box might be this one
https://github.com/salesagility/SuiteCRM/blob/master/modules/Emails/EmailsController.php#L359

I am not sure about these things but I hope this helps.

@ApatheticCosmos
Copy link
Contributor

@pgorod That's exactly it. I'm digging in to figure out why it's not returning anything. It looks like the output can be viewed directly (in JSON format) by going to:
[site-url]/index.php?module=Emails&action=getFromFields
It's returning an empty array right now.

@ApatheticCosmos
Copy link
Contributor

As a test / WIP, I've added the following code to modules/Emails/EmailsController.php at line 443:

        if (empty($data)) {
                // No sending addresses found. Add users email address as a fallback.
                $data[] = array(
                        'type' => 'personal',
                        'id' => '',
                        'attributes' => array(
                                'from' => $current_user->email1,
                                'name' => $current_user->full_name,
                        ),
                        'prepend' => $prependSignature,
                        'isPersonalEmailAccount' => true,
                        'isGroupEmailAccount' => false,
                        'emailSignatures' => $defaultEmailSignature,
                );
        }

After doing so, the users name and address show up in the dropdown when composing an email, and the email gets sent properly.

In no way is this production level code, but it (almost) produces the results I'm looking for. I'm going to see if I can add a checkbox option on the admin page to enable/disable this behavior. I also need to figure out how to get the signature working. The signature is in the JSON data, but not showing up in the compose window, or being sent with the email. And what if the user has multiple email addresses? I should get that working too.

Anyway... this isn't really a fix for this particular bug anyway. It's a change to the email functionality. Maybe this code will be useful to someone who comes looking for it.

@ApatheticCosmos
Copy link
Contributor

ApatheticCosmos commented May 25, 2018

I got the signature to work. Insert in modules/Emails/EmailsController.php at line 443:

        if (empty($data)) {
                // No sending addresses found. Add users email address as a fallback.
                $GLOBALS['log']->fatal(print_r($defaultEmailSignature, true));
                $data[] = array(
                        'type' => 'personal',
                        'id' => $current_user->id,
                        'attributes' => array(
                                'from' => $current_user->email1,
                                'name' => $current_user->full_name,
                        ),
                        'prepend' => $prependSignature,
                        'isPersonalEmailAccount' => true,
                        'isGroupEmailAccount' => false,
                        'emailSignatures' => array(
                                'html' => utf8_encode(html_entity_decode($defaultEmailSignature['signature_html'])),
                                'plain' => $defaultEmailSignature['signature'],
                        ),
                );
        }

@parijke
Copy link

parijke commented Jul 10, 2018

same issue here on Version 7.10.6

@boombata
Copy link
Contributor

I think I got a fix and have outbound emails listed now:

edit /include/SugarFolders/SugarFolders.php line 612

from
$folders = $this->retrieveFoldersForProcessing($focusUser);

to
$folders = $this->retrieveFoldersForProcessing($focusUser, false);

Problem introduced by this PR https://github.com/salesagility/SuiteCRM/pull/4877/files

@dhayner
Copy link

dhayner commented Aug 3, 2018

I tried @boombata's fix and a QRR, and still have a blank From: dropdown in Compose Email. I do have a personal box setup for send & receive, and receive is working properly while the send-test also works.

@Dillon-Brown Dillon-Brown added this to the 7.10.10 milestone Sep 28, 2018
@fcorluka
Copy link

I am on 7.10.7 and can see in dropdown all outbound emails that are created, but in sent mail is always the one from system settings.
Also when I disable 'Allow users to send from this ..' email cannot be sent.

I have mentioned before that whole EMAIL module with Inbound and Outbound is broken and needs fix.

@Dillon-Brown
Copy link
Contributor

Dillon-Brown commented Oct 19, 2018

@fcorluka I would suggest upgrading to 7.10.9, there have been many fixes between 7.10.7 and 7.10.9. If you are still able to replicate those bugs then i'd suggest raising issues for them.

@fcorluka
Copy link

fcorluka commented Oct 19, 2018

@Dillon-Brown
I have tried 7.10.9 version (clean install) but no success.
I have passed trough issue list and I have got every issue there is with emails.

I will open a new issue, but generally Email need revision. I am free to help with testing and describing all of my problems to whoever is in charge of Emails.

@Dillon-Brown
Copy link
Contributor

@fcorluka All assistance is appreciated! the next release should contain fixes for several of the current high priority issues and we're currently working on a set of unit/acceptance tests for inbound/outbound emails so we hopefully won't need to fix any of these issues again.

@fcorluka
Copy link

@Dillon-Brown do you have a date of next release?
I would be willing to test it prior to the official release and give you feedback.

@Dillon-Brown
Copy link
Contributor

@fcorluka I don't have an exact date but it shouldn't be very far off. We do have a nightly build (User/Pass Will/Will) which pulls from the latest hotfix but I can see how that wouldn't be ideal for email testing since it's publicly available. I'd normally suggest pulling down straight from git to test the latest changes.

I'll take a look at those issues you've raised and see what I can replicate and confirm. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Emails Issues & PRs related to all things regarding emails & email module Priority:Critical Issues & PRs that are critical; broken core functionality, fatal errors - there are no workarounds Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests