Trying to improve product notification email

Open to all! Ask other shopowners for help.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Trying to improve product notification email

Post by LeeFoster »

Pierre_P wrote: Tue May 24, 2022 6:29 am Hello @14Steve14 @Dan Cole

I'm on the same road to html mails as my older Phoenix are still using Uhtmls

There was an old discussion on this that Dan started on html emails at https://forums.oscommerce.com/topic/496 ... nt-1817019
Dan did manage to get html emails working using the Pages addon on a earlier version of Phoenix.

For me this is a bit vague but will also give it a try!
Having read through the topic above it got me thinking, could we also use the info pages addon for things such as the packing slip and invoice?

I'm sure there are also other things it can be used for but these stand out for me.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Trying to improve product notification email

Post by burt »

LeeFoster wrote: Tue May 24, 2022 8:00 am Having read through the topic above it got me thinking, could we also use the info pages addon for things such as the packing slip and invoice?

I'm sure there are also other things it can be used for but these stand out for me.
Yes, the way it is built (the slug system) allows it to be used for anything - it's super flexible.

Have a look at the system file for info_pages includes/system/versioned/1.0.7.6/info_pages.php - in this file if I recall correctly I put a couple of examples of how to call info_page(s) and how to display them.

You can also take a look at the core MATC for an example of something that uses the info_page system, but which is not an info page.
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Trying to improve product notification email

Post by LeeFoster »

burt wrote: Tue May 24, 2022 8:19 am Yes, the way it is built (the slug system) allows it to be used for anything - it's super flexible.

Have a look at the system file for info_pages includes/system/versioned/1.0.7.6/info_pages.php - in this file if I recall correctly I put a couple of examples of how to call info_page(s) and how to display them.

You can also take a look at the core MATC for an example of something that uses the info_page system, but which is not an info page.
Got a few things to be doing today but will be looking at this later today.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Trying to improve product notification email

Post by 14Steve14 »

I sort of forgot all about this. Got bogged down with work and it all got put on the back burner. All I did do was to alter the text in the emails that are sent and thats it really. I just altered the notifications email, the recover carts email and the order confirmation email.

The notification email seems to have a desired effect as a few customers have replied or purchased. It may be the new text or the fact that we have started sending them again.

The recover carts emails definately work as we get lots of emails from customers who receive them, and a few sales.

The order confirmation emails just include a big long thanks section, plus the other standard info about the orders and a few legal bits about ortder cancellations. Seems to get several responses.

May find time in the near future to have a look again.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Trying to improve product notification email

Post by heatherbell »

burt wrote: Tue May 24, 2022 8:19 am Yes, the way it is built (the slug system) allows it to be used for anything - it's super flexible.
Just playing with this idea for the sake of learning but obviously not doing it right.
Set MIME HTML emails to true.
Created an Info Page with
slug = orderConfirmation
and
Pages Text =
<div><img src="https://mywebsite/images/store_logo.png" alt="Phoenix Cart"></div>
Edited /includes/modules/notifications/templates/tpl_n_checkout.php to this:

Code: Select all

 Released under the GNU General Public License
*/

    $pages = info_pages::getElement(['p.slug' => 'orderConfirmation',
                                      'pd.languages_id' => $_SESSION['languages_id'], 'pages_text']);

// let's start with the email confirmation
  echo $pages . STORE_NAME . "\n"
     . MODULE_NOTIFICATIONS_CHECKOUT_SEPARATOR . "\n"
Sadly the email still works but does not show the image.
Any pointers gratefully received.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Trying to improve product notification email

Post by Kofod95 »

heatherbell wrote: Wed May 25, 2022 6:55 am Any pointers gratefully received.
using

Code: Select all

$pages = info_pages::get_page(['p.slug' => 'alerts',
                             'pd.languages_id' => $_SESSION['languages_id']);
                 
            echo $pages['pages_text'];                      
                                      
works. I couldn't get getElement to work either, not sure why. Might try to find out

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Trying to improve product notification email

Post by Kofod95 »

Found it:

Code: Select all

    $pages = info_pages::getElement(['p.slug' => 'alerts',
                                      'pd.languages_id' => $_SESSION['languages_id']], 'pages_text');
The array must be closed before asking for the element

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Trying to improve product notification email

Post by heatherbell »

Kofod95 wrote: Wed May 25, 2022 8:13 am The array must be closed before asking for the element
That's what I get from copy/pasting! :facepalm: :roll:
Just that change of bracket and the email displays with the image as expected.
Many thanks - this will open a new box of Lego with which to play - "leg godt med Phoenix!" :D
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Trying to improve product notification email

Post by Kofod95 »

heatherbell wrote: Wed May 25, 2022 8:52 am this will open a new box of Lego with which to play - "leg godt med Phoenix!" :D
Happy to help! :)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Trying to improve product notification email

Post by burt »

I tried to make that infopages system as flexible as I could at the time whilst working on many other things. It remains (mostly) unexplored for now - I think there were a few Supporter Code extras for it which might be useful...

Note that as the infopages controlling file is a class, it can be easily extend/override to better suit your needs (and of course if anyone comes up with something cool that I did not think of originally for that class file or the infopages ecosystem in general, please share for potential adding to core). Overriding would be done in /includes/system/override/
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply