Postal mail campaign

Hi all,

I want to send postal mail to my contacts and I’d like to do it with SuiteCRM.

What I need is to be able to select all the contacts I want to send postal mail to and produce a letter-type-of-document featuring their name and address along with the body of the message for later printing.

Is there a way to do it ?

On the top menu, select “All” and then “PDF Templates”. You create your letter template here, and you can use fields for Customer name, etc.

Then on the Contacts Detail view, you have a button on top (along with Edit, Duplicate, etc.) to “Generate Letter”.

Also on the Contacts/Leads/Targets List View, you can search, then select several (or all) contacts, and from the Action menu select Generate Letter. This will make a single PDF with many pages, one for each contact. (If this option doesn’t show, that’s a bug which I had once, fixed it, and now I’m getting it again! Can’t remember how I solved it though).

Finally, I see that in the Campaigns module, there are campaigns without email (“Non-email based campaign”, on the first step of the Create wizard). I haven’t tried it, maybe it’s just a way of tracking responses, etc. but you might want to look there also and experiment.

Thank you for your prompt answer :slight_smile:

Indeed, the Action menu shows but the option “generate a document” won’t in any list (neither Contacts nor Targets nor Leads). It only shows in the single contact view but then does nothing (clicking won’t do anything).

In the campaigns module I’ve tried the Non-email based campaign but whatever I do, it does nothing, that is it doesn’t even save my campaign.

I’m puzzled.

I found the other thread when I had this problem, see here:

You can see the screenshots there to know where the option should be.

My final post has the technical solution that worked for me, I hope it might work for you also. It will depend on whether you have customizations and on your specific upgrade path (if you’re coming from versions before 7.5).

1 Like

It’s a fresh install and I’ve only created 3 contacts, 3 prospects and 3 leads for testing purposes. I’ve eventually managed to find the option to generate a document but then nothing happens excepts I’m redirected to the home page… and nothing is to be found in the documents list though the crm is supposed to have generated a list.

I’m clueless for now but thank you for the link I’ll study the doc and post an answer if I find one.

Do you, at least, get a pop-up asking you which template to use?

Make sure you create a PDF Template first, that might help.

Try a different browser.

Then you can always check your logs to see if any error occurs when you press “Generate letter”.

Finally, check your permissions - that’s always a first place to start.

Relevant files would be:
custom/modules/Contacts/views/view.list.php (better if this file doesn’t exist)
modules/Contacts/views/view.list.php (check permissions)
modules/AOS_PDF_Templates/formLetter.php (check existence and permissions)

Good luck

1 Like

Yes, I do get the template question and I choose the template I created.

I’ll check the logs. Thanks for the info.

Ok. I now get a 500 internal server error each time I click on “Generate document”. I am puzzled.

  • Version 7.7.8 > fresh install on a private OVH database.

  • Files permission is 775.

  • Nothing to be found in suitecrm.log

I both clean the cache and run the repair tools to no success.

Could there be something to do with the .htaccess file ?

Dear vincegar72,

It looks like a permissions issue on the onset.

Have you taken care of permissions issues before installing the Suite CRM?

If not, dig a little deeper in forum posts concerning Permissions. After necessary changes, install it.

With thanks,


I did. But then I changed them all to 775 following the recommendation found in one post in this forums to address the “undefined error” text appearing a bit too often.

I set the permissions back to what they should be following the official documentation.

Now I’m back to my starting point : Nothing happens after I click on the PDF template I want to use. Where is it suppose to show ?

When you talk about permissions, you should also talk about ownership; one thing doesn’t even make sense without the other. You need to both apply correct permissions and ownership, at the same time. Have you been doing that?

Your cron jobs shouldn’t be running as root, but rather as your web-server user.

When you generate the document, your browser should offer to download it or save it. Basically, SuiteCRM makes you open a link that points back to the file on the server’s file system.

Indeed, I’ve double checked that both ownership and permission were ok. They apparently are but I still don’t get any link. After clicking on the pdf template, it goes back to the welcome page. No error message, no prompt, just nothing. I’m confused.

Any idea if there’s a relevent log for this type of process ?

Thank you for your interest. I hope I can sort it out.

There’s suitecrm.log, you can set the log level to DEBUG in System settings, you should catch something there.

I’m not sure if the generated document is stored in the database or on the filesystem (taking a quick look, I couldn’t find any of mine there).

If I was in your position I would try debugging the code step-by-step to see where it’s breaking, but maybe you’re not a developer…

Thank you for pointing out the debug option. Indeed the logs are far more verbose now ! Yet, I get neither errors nor warnings. The request seems to be processed normally but then again, nothing happens.

Now, there seems to be a plugin called “Mail Merge Reports” that needs to be enabled on the client machine. Is it possible that generating documents rely on this ?

As for now, I am totally unable to perform a mail campaign and/or generate documents. Is that the expected behaviour if youo don’t have this plugin installed or should it work withour it ?

Actually, to make sure I did everything right :

1- Is it correct to specify my webserver user and group in the config.php file ? (It changes nothing to the outcome but I just wanted to make sure I was right to do so).
2- You may be able to understand my log better than I can though I see nothing wrong here, but then again, I may be wrong, so here it is :

Thu Jan 5 19:19:34 2017 [29396][-none-][INFO] Query:SELECT users.* FROM users WHERE = ‘1’ AND users.deleted=0 LIMIT 0,1
Thu Jan 5 19:19:34 2017 [29396][-none-][INFO] Query Execution Time:0.00023484230041504
Thu Jan 5 19:19:34 2017 [29396][1][DEBUG] get_user_array query: SELECT id, first_name, last_name, user_name FROM users WHERE 1=1 ORDER BY first_name, last_name ASC
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query:SELECT id, first_name, last_name, user_name FROM users WHERE 1=1 ORDER BY first_name, last_name ASC
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query Execution Time:0.00015592575073242
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query:SELECT u1.first_name, u1.last_name from users u1, users u2 where = u2.reports_to_id AND = ‘1’ and u1.deleted=0
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query Execution Time:0.00015377998352051
Thu Jan 5 19:19:34 2017 [29396][1][DEBUG] SugarBean[User].load_relationships, Loading relationship (reports_to_link).
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query:SELECT ea.email_address, ea.email_address_caps, ea.invalid_email, ea.opt_out, ea.date_created, ea.date_modified,, ear.email_address_id, ear.bean_id, ear.bean_module, ear.primary_address, ear.reply_to_address, ear.deleted
FROM email_addresses ea LEFT JOIN email_addr_bean_rel ear ON = ear.email_address_id
WHERE ear.bean_module = ‘Users’
AND ear.bean_id = ‘1’
AND ear.deleted = 0
ORDER BY ear.reply_to_address, ear.primary_address DESC
Thu Jan 5 19:19:34 2017 [29396][1][INFO] Query Execution Time:0.00024008750915527
Thu Jan 5 19:19:34 2017 [29396][1][DEBUG] Hook called: Users::after_retrieve


yes, it’s ok to specify webserver user and group in config.php.

I never heard of that plugin you mention, I don’t think any special add on is required for this functionality.

I don’t see anything suggestive in your logs.

I’m a bit out of ideas, unless you can debug the code (step through it line by line) you might never know what’s wrong - it could be some weird combination of Linux vs PHP versions or some bug.

If it’s a fresh install you might be better off just moving to a different flavor of Linux and restarting. You shouldn’t be getting these problems. Sorry I can’t be of more help…

1 Like

Well, thank you anyway for your help ! SuiteCRM is actually hosted on an OVH server and the database is hosted on a privateSQL at the same service provider, so there’s nothing I can do about changing distros.

At this point, I’m thinking of installing it locally to see what happens.

Finally found why. My problem came from the MySQL version I use (5.7) which is not yet compatible with suiteCRM.

Found a workaround here :


I am surprised of how it breaks the app in your case… there should be a fatal SQL error in the logs.

About the workaround: which one did you apply?

It would be nice for the project to validate the fix about to be included in the next version, so if you could leave the SQL_Mode as it was, and instead just change the DBManager code (as specified in that thread also), it would be a nice confirmation that the next version will actually be compatible with MySQL 5.7.

Dear vincegar72,

I am also glad to know that the solution offered there by me has helped you also. I was not aware that problem I had there, is actually in some manner, was related to problem you were facing too.

Well, I also had attempted to solve that issue with the help of @pgr yesterday. He is nice and approachable & responsive.

I am glad that my intention behind sharing the complete solution, fully & graphically, has helped you also. May be it will help many guys more!

There is one more info which I can share that probably the Fix offered (w.r.t. DBManager.php) is not working with PHP 7. I have seen some able developer mentioning that.

However, SalesAgility developers are most likely to build this compatibility with future upcoming version of SuiteCRM 7.8.

With great many thanks,


1 Like