Jump to content

ProcessEmailToPage


Pete

Recommended Posts

Hi @adrian 

I tried the new version of Flourish and it's the same. I also switched to PHP 7.0.4 and it still does the same. Whereas my improved version works in both versions of PHP.

The problem that Werner and I had isn't to do with PHP 7 or HTTPS vs HTTP rather connecting to the POP3 server using an unsecured connection (Force secure set to off). 

My version fixes the fMailbox.php file while keeping all security settings in place.

 

I've included it for anybody who comes across this same problem.

fMailbox.php

Link to comment
Share on other sites

Thanks again @RDC - I am wondering if perhaps you'd consider submitting a PR to the Flourish guys - seems like it would be a good change for all their users. Once it is in their repo, I'd be happy to include the updated version in this module.

Link to comment
Share on other sites

  • 1 year later...
2 hours ago, tires said:

Is there a way to split an email text (for example the subject text) with an hash (#) to save it in a field?

I think the only way to send different content from the email to different fields is using the delimiters options. Have you tried to achieve what you want with that? Or am I missing the point? I don't think I really understand the "hash" idea you are talking about.

Link to comment
Share on other sites

Delimiters are good ... but i think a bit to complicated for inexperienced users.

My idea was to keep it simpler:
If the subject of the email is "My super test email #test #cool #funky", the title of my page should be "My super test email" an the tags should be "test", "cool" and "funky".

 

Link to comment
Share on other sites

On 9/1/2018 at 11:51 AM, tires said:

Delimiters are good ... but i think a bit to complicated for inexperienced users.

My idea was to keep it simpler:
If the subject of the email is "My super test email #test #cool #funky", the title of my page should be "My super test email" an the tags should be "test", "cool" and "funky".

 

This should be doable, but I guess the problem may be how the tags field stores these. Are you using page reference field for tags, or a select options field, or some other approach? In implementing this I'd want to make sure it worked in as many scenarios as possible.

Although I am not really sure if this module gets much use at all - it seems pretty quiet around here and personally I have never had a use for it (even though I helped extend it quite a bit since Pete's initial development). 

Link to comment
Share on other sites

5 hours ago, adrian said:

Although I am not really sure if this module gets much use at all - it seems pretty quiet around here and personally I have never had a use for it (even though I helped extend it quite a bit since Pete's initial development). 

I use this module on every website I have built for myself personally and also clients

  • Like 4
Link to comment
Share on other sites

12 hours ago, adrian said:

I am not really sure if this module gets much use at all - it seems pretty quiet around here

This may also be an indication for modules that work well and fulfil a task perfectly, leaving nothing to be desired. ?

  • Like 4
Link to comment
Share on other sites

41 minutes ago, horst said:

This may also be an indication for modules that work well and fulfil a task perfectly, leaving nothing to be desired. ?

That's indeed the case, for me.  As both a Telecommunications Engineer and Web Developer, this module allows me to use emails (from submitted forms or sent directly from someone's mail account) to aid in generating webpages.  Just a few of the many things that I use this module for:

  • Blog Submissions
  • Article For Review/Approval Submissions
  • Form Builder Submissions
  • Status Updates (to already created subject areas)

The fact that you can submit to multiple email addresses allows for multiple uses of this module.

If you can think outside-of-the-box, you would be surprised how useful this module can be.  I'm glad that you extended the original module from @ryan.  When you did, I saw instant usability for this module.

 

  • Like 3
Link to comment
Share on other sites

Thanks for the feedback @cstevensjr - glad to hear it has served you well, although I must point out that Pete was the one who did all the initial work with this module - I just picked up the torch and added a bunch of new features.

I'll wait to hear back from @tires about how he is storing tags and we'll go from there.

  • Like 2
Link to comment
Share on other sites

I'am actual setup a usecase - where a customer have to create directly from his smartphone new pages with some kind of marketplace content (second hand agriculture machines) so the easy way to go is telling him - take a picuture go to the share button write a title and a description...tidy up later if you want back in the office...

Using it private for recipies....cooking same procedure i like it very much and out of the box thinking is may default way to think since i'm not so experienced in programming i've to use the tools that i could handle ?

best regards mr-fan

 

  • Like 1
Link to comment
Share on other sites

On 9/3/2018 at 7:13 AM, adrian said:

This should be doable, but I guess the problem may be how the tags field stores these. Are you using page reference field for tags, or a select options field, or some other approach? In implementing this I'd want to make sure it worked in as many scenarios as possible. 

You are right. The tags should be saved as a new page via page reference field.
I guess that is the most common way to handle it, right?

Link to comment
Share on other sites

  • 1 month later...

Hi everyone,

@dab has kindly sponsored support for multi-language subjects and content which I have just added to v1.3.0

Here is my test email content which will hopefully show you how it works.

Subject

English Subject ==#es== Spanish Subject ==#fr==  French Subject

 

Body

English body

==#es==

Spanish body

==#fr==

French body

==sidebar==

Sidebar english

==sidebar==#es==

Sidebar spanish

==sidebar==#fr==

Sidebar french

 

There is also a new "Auto Activate Languages" checkbox that you'll probably want to check in the module config settings.

Please let me know if you have any problems with this new functionality.

Cheers,
Adrian

  • Like 3
Link to comment
Share on other sites

Also just wanted to mention that when building this ML stuff, I had to setup a new test email address because gmail addresses no longer work with this module. Turns out Outlook (hotmail) ones don't either. I ended up using a Yandex address. In case anyone finds it useful, these are the settings I used:

image.thumb.png.6b0c4b81127139de29cbedbdb9fe5758.png

Hope that helps!

Link to comment
Share on other sites

  • 2 months later...

I was just wondering if perhaps anyone has had this issue before. I am pulling in some emails for a system (all the emails are in tables etc), but some of my emails are getting cut off half way through.

For example, the original email has an image with text to the right of it, but in my body field, the code is cut off right after the image and does not pull in the rest of the email. I body field set to not maximum, but for the life of me I can not figure out the issue. Any help would be appreciated.

Link to comment
Share on other sites

  • 5 months later...

Any reason why the sanitizer is used to strip all but the most basic tags from the emails? I just realised that it strips <ol> <ul> and <li>. I've hacked my copy to fix this, but would it perhaps be better to set the allowable tags as an option, with the basic ones as default?

Link to comment
Share on other sites

5 hours ago, MarkE said:

Any reason why the sanitizer is used to strip all but the most basic tags from the emails? I just realised that it strips <ol> <ul> and <li>. I've hacked my copy to fix this, but would it perhaps be better to set the allowable tags as an option, with the basic ones as default?

I don't know - we'd have to get @Pete's input on why that was done, but if you want to put together a PR to add a module setting where these can be configured, I can push to the main repo.

Link to comment
Share on other sites

Thanks @adrian - At the moment, I have simply added the tags <ol>, <ul> and <li> to the allowableTags in lines 510 and 514. I haven't created a configuration option. I think it might be better, however, to adapt the existing "inline images" option to be a "rich text and inline images" option, using sanitizer->purify rather than sanitizer->textarea. I've struggled to code this, however, as I am unsure about the options in sanitizer->purify. I thought it should work without any options but, although it allows rich text, it doesn't seem to like the inline images and I can't see how to make it permit those.

Link to comment
Share on other sites

3 hours ago, MarkE said:

I thought it should work without any options but, although it allows rich text, it doesn't seem to like the inline images and I can't see how to make it permit those.

Not testing in the context of this module, but this looks to work as expected:

image.png.41c4d348f7da2381d700117cd45cb953.png

Does that work as expected at your end?

Link to comment
Share on other sites

Hmm... I think the sanitizer itself works as you say. There's something else interfering which I don't understand. For info, my use case is to distribute emails from committee members to other committee members and keep a central repository, so there are several steps in the process - the module, email clients and PW core (plus my own code) - so finding the culprit is proving a bit tricky.

The body field I am using has HTML Purifier enabled, so using it in the module doesn't really do anything (apart from seeming to add spurious <p> tags).

As regards amendments to the module, on reflection, it seems that there are several possibilities for adding options:

  1. Further allowed tags
  2. Set stripTags =>false
  3. Use sanitize-purify rather than sanitize->textarea
  4. Don't sanitize (rely on host field sanitization)

.. and maybe more. Given this, it might be best to wait and see what @Pete thinks.

 

  • Like 1
Link to comment
Share on other sites

I haven't used this module in awhile and now I'm having a problem with a body TextArea field on a new website installation.

If I add the following text "This is a test" in an email body, this is what shows up in the created page in the body field.  This field is configured for CKEditor and has the HMTL Purifer applied to it.

P {margin-top:0;margin-bottom:0;} This is a test

I then created an additional TextArea field and left the Inputfield Type as Textarea and I still have the same problem.  This time is shows up as follows:

P {margin-top:0;margin-bottom:0;} 



This is a test

 

Any help that can be provided to getting rid of the extra formatting information is greatly appreciated.

Link to comment
Share on other sites

I have the same problem - I think it is caused by some email clients placing

<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>

inside a <head> tag. Something then deletes the <style> tag. The culprits could be any of:

  1. this module
  2. HTMLpurifier for the textarea field
  3. CKeditor

Unfortunately, I have not been able to replicate it with my email client, so checking where the problem is has been tricky.

I think that it is most likely (1) or (3) or both. To eliminate (3), place style{display} in the CKeditor "extra allowed content" of your textarea field (input tab). If it still happens, you could try hacking lines 511 and 514 of ProcesEmailToPage.module to include <style> in the list of allowed tags.

Let me know the results, Ta.

UPDATE: Hi @cstevensjrI managed to create a test email using gmail and developer tools. I think you need to fix both 1 & 3 as per my suggestion. You will see from my previous post that I have suggested a module change to avoid trapping tags like this.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I've got a project where this module may work nicely. One question however: has anyone found a way to update an existing page via email with this? Like send an email to a specific address or with a specific field that will find an existing page and replace a field's content? I'd appreciate any suggestions or ideas along these lines.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...