Author Topic: Hack: send an email to groups through tag support in email field autocompletion  (Read 6505 times)

yannick-guerin

  • Guest
Hello,

Our organization needed to send emails to more than one contact easily, and this is not possible with current version of fengoffice as far as I now ( if you know how to do it properly, please let me know).

So I hacked 3 files related to email to enable this through tagging system.

The Idea is to Tag contacts. This tags are then offered in the autocompletion list when you type something in the A: field.

When you hit one tag in the list with the Enter key, the complete list of contacts with this tag are added to the A: field, like another address.

I don't know if it's the good way to go, but it works.

I attach the first version that is currently running in our production site, but there's one bug: one cannot select something in the list with the mouse. If someone is good in javascript...
This version also contains another hack: it replaces Company email with every contacts that belongs to a company (this was the first way I tried to do it). If someone is interested, I can release a version with only the Tag hack.

Instructions:

For fengoffice 1.7.3 only!!

copy AutocompleteTextarea.js to public/assets/javascript/og/
copy add_mail.php to application/views/mail/
copy Companies.class.php to application/models/companies/

Erase your cache for updating the javascript file or hit Ctrl + F5 in firefox.

Once again, I'm not familiar with MVC, so code is probably wrong, but it can help others.

Tag some contacts and test the autocompletion when writing a new mail.

Off topic: if someone is interested, I'm currently working on integrating joomla and fengoffice (events and documents). Integrating events is not complicated with use of Jevents, but I'm developping a component for retrieving fengoffice documents via fengoffice Webservice.


Yannick
« Last Edit: December 21, 2010, 06:37:28 pm by yannick-guerin »

Tittan

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hi yannick,

I'm very interesting in use and developer webservice integration.
Which is the url I have to call basic webservice?

Do you have information about this and architecture mechanism?

Very thanks.

Tittan

forbesuk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi

Has anyone been able to get this to work in 1.7.4?


hightower

  • Newbie
  • *
  • Posts: 3
    • View Profile
I updated my system to 1.7.5 and use these files - but it doesn't work  :-\!
Can you give a hint what I have to change?

What happen:
the company-tag is companyA
If I hit the first "c" no companyA tag is in the list?!
what did I wrong? Is it the new version?

thx for help

forbesuk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi

Has anyone been able to get this to work in 1.7.5?

forbesuk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Thanks Yannick. That worked even better than before.

simonwenger

  • Freshman
  • *
  • Posts: 26
    • View Profile
Wow, Yannick!
Thanks! Works perfectly!

Spina

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi all,
in attached (you need to login) a patch based on yannick-guerin's patch that find email also into compianies. You can send an email to all contacts and companies labeled before.

To apply the patch (under linux):
$> cd fengoffice
$> zcat  fengoffice_1.7.5_email_with_tags.diff.gz | patch -p1

Enjoy,
Emanuele