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

Email Template functionality #76

Closed
aaronjudd opened this issue Jun 2, 2014 · 4 comments
Closed

Email Template functionality #76

aaronjudd opened this issue Jun 2, 2014 · 4 comments
Assignees

Comments

@aaronjudd
Copy link
Contributor

Need to fix email sending functionality. Used to work with Handlebars parsing on server side, this no longer works, nor is it the ideal solution. Need to move into database, and manage email from admin interface.

@aldeed
Copy link
Contributor

aldeed commented Aug 26, 2014

As discussed elsewhere with @aaronjudd, I will work on doing this as:

  • Email config package with admin interface and scheduler
  • Multiple emailer packages that talk to the email config package and make calls to external APIs when necessary (i.e., mandrill, sendgrid, mailgun).

The email schedule process will be kept separate, too, such that you could run it as a separate app connected to the same DB, to avoid negatively impacting user response times on the main app.

I envision the email config would let an admin send e-mails based on system events (order submitted, order shipped, etc.) or based on timing and criteria. The criteria for the "timing and criteria" type may have to be configured in code, so that advanced logic can be used. We can include some default "criteria" definitions and make it easy for a developer to add her own. For example, we could provide a default "users who placed an order in the last 24 hours" criteria. Then, in the admin interface, you can select that criteria, enter a schedule of "every day at 6 AM UTC", and enter the name of the mandrill/sendgrid/mailgun template to send to those users at that time. (We will pass some placeholder values to the APIs, too, in case the templates want to use them, e.g. name, order info).

Questions for @aaronjudd and others with an opinion:

  • Which pieces of this are essential and which are "nice to have"?
  • What is the list of system events that should be able to cause an e-mail to be sent?
  • How should the admin interface be accessed and what should it look like? It seems as though the "inline editing" style wouldn't apply for something like this.

@aaronjudd
Copy link
Contributor Author

@aldeed I think any of the events in the register new accounts, + client/workflow events should have email templates associated. Initially, the must haves are the OrderWorkflowEvents.

I think in the default admin panel (where settings,etc) we should just have a dropdown that you select an event, and a text area that lets you edit templates (with an option to reset to default), and enable/disable functionality.

I agree that having some query criteria events and be able to send a template to matching records is important, might not be the first requirement, but it's a good one - particularly important for abandoned carts,etc

@aaronjudd aaronjudd added this to the v0.2.2 milestone Nov 7, 2014
@aaronjudd aaronjudd modified the milestones: Email Templates, v0.2.3 Jan 19, 2015
@aaronjudd aaronjudd added ready and removed bug labels Jan 19, 2015
@aaronjudd
Copy link
Contributor Author

@aldeed I can actually take a portion of this in the guest_checkout branch. I propose to start, rather than reading files for the email templates, we move email templates into a collection, with a config object. The config object might just be a placeholder for now. I'll load the templates as fixtures, as with languages,etc. This will setup to an editable interface, and additional config properties for a scheduler / service mapping later.

@aldeed
Copy link
Contributor

aldeed commented Mar 12, 2015

Makes sense

aaronjudd added a commit that referenced this issue Mar 24, 2015
Thanks to contributions from @danielgindi `right to left internationalization` is now supported.

Take a look at the Russian or Hebrew languages to see RTL in action.

 - Resolves #176

Also contributions from  @firstred and @epson121 added Dutch and Croatian translations.

Thanks to contributions from @lovetostrike, the initial `reactioncommerce:reaction-social` package has been published, which gives basic social sharing functionality.

 - Resolves #61
 - Resolves #281

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- Session handling will need a **close review in the future**.
- potential edge cases where multiple session/auth/merge actions to a cart may destroy the cart
- cart really should have mirrored client and server methods and be tested offline

Issue updates:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

   * dashboard enable/disable **guest checkout**
   * change default step to **guest checkout** or create/sign-in
   * store email for order - **after order completion if guest**
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

Thanks to initial contributions from @prinzdezibel!

- use new Accounts collection (previously referred to as customers)
- create account on user create, or use a session specific account
- implement Template.dynamic handling of AddressBook edit/add/grid
- changes to checkout address handling, fix accounts context
- update addressBook forms to autoform-v0.5.0 compatible (autoform not upgraded)
- change accounts/shop `email` from string to `emails` array
  - `emails: {'address': options.email, 'verified': true}`
- changed Shops, Accounts email to an array `emails`
- userAccountsDropdown icon for orders, profile
- user view of order history

TODO:

- merge session accounts to user account upon email confirmation (and email saved on cart)
- reduce / cleanup garbage sessions  (merge will help)
- session / accounts/ cart garbage collector
- account profile / settings
- on account creation / login  with password
    - if confirmed account creation email
      - create a account collection record with this userId
      - update all orders with matching email to match this userId
      - copy all order addresses into Accounts.profile.addressBook
      - copy all social / email info to Accounts.
      - users collection locked down, nothing exposed to client, used for authentication only
    - else
      - if there are more orders with this email
      - display on order view "Add order"

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.
- remove sessionId from orders on logout

* updates to handling settings from registry (public, private)
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Issue updates:

- Strategic updates for issue #236
- Strategic updates for issue #327

* added settings.public to publish public settings to ReactionCore.xxx

Thanks to contributions and docs from @spencern

- Test coverage for product methods
- Fix, add coverage for core methods

* Upgrade to Meteor 1.0.4.2
* Implements `check` and `audit-argument-checks`
* Implements `browser-policy`
* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.
* **Contributions from @aldeed @prinzdezibel @spencern @boboci9 @evliu @ceh @gouthamve @KEFIRCHIK @epson21 @firstred
**
@aldeed aldeed removed their assignment May 16, 2015
aaronjudd pushed a commit that referenced this issue Dec 3, 2015
Allow checkout as guest (without user account)
aaronjudd added a commit that referenced this issue Dec 3, 2015
**Cart**

*The goal is a reactive offline / online multisession-multishop-multidevice cart.*

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- It will need a close review in the future.
- there are some edge cases where multiple authentications
or merges to the same cart may destroy the cart
- Cart really should have mirrored client and server methods
to allow adding to cart while offline
- allow multiple sessionId per cart when userCart
- consider implementation of this as part of Accounts

Updates issues:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

**Checkout**

   * dashboard enable/disable guest checkout
   * change default step to guest checkout or create/sign-in
   * store email for order - after order completion if guest
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

**Accounts**

  * use new Accounts collection (previously referred to as customers)
  * userAccountsDropdown icon for orders, profile

  TODO:

- account profile / settings
- on account creation / login  with password:

    if confirmed account creation email
      create a account collection record with this userId
      update all orders with matching email to match this userId
      copy all order addresses into Accounts.profile.addressBook
      copy all social / email info to Accounts.
      users collection locked down, nothing exposed to client, used for authentication only
    else
      if there are more orders with this email
      display on order view "Add order"

**Packages**

* added settings.public to publish public settings to ReactionCore.xxx

**Orders**

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.

**Dashboard**

* updates to handling settings from registry
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Strategic updates for issue #236
Strategic updates for issue #327

**General**

* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.

Related issues @aldeed @prinzdezibel
aaronjudd added a commit that referenced this issue Dec 3, 2015
Thanks to contributions from @danielgindi `right to left internationalization` is now supported.

Take a look at the Russian or Hebrew languages to see RTL in action.

 - Resolves #176

Also contributions from  @firstred and @epson121 added Dutch and Croatian translations.

Thanks to contributions from @lovetostrike, the initial `reactioncommerce:reaction-social` package has been published, which gives basic social sharing functionality.

 - Resolves #61
 - Resolves #281

- if there is neither a sessionCart nor a userCart, create a sessionCart
  * add sessionId to cart.sessions
  * auto insert/update userId if authenticated
  * observers to ensure cart always exists (ie after deletion)
- if sessionCart is a not a userCart return sessionCart
- if sessionCart just authenticated, add userId
- only return a user cart when authenticated
  * copy existing userCart(s) into sessionCart and remove userCart(s)
- if userCart just logged out, remove sessionId from userCart and create new sessionCart
- allow multiple sessionId per cart when userCart

TODO:

- realistically this may not be very solid way to handle sessions.
- Session handling will need a **close review in the future**.
- potential edge cases where multiple session/auth/merge actions to a cart may destroy the cart
- cart really should have mirrored client and server methods and be tested offline

Issue updates:

- Remove packages introduced in reactioncommerce/reaction-core#76
- Resolves #271
- Resolves #339
- Resolves #326
- Resolves #183
- Strategic updates for issue #16
- Strategic updates for issue #318
- Strategic updates for issue #76

   * dashboard enable/disable **guest checkout**
   * change default step to **guest checkout** or create/sign-in
   * store email for order - **after order completion if guest**
   * not visible after destroyed session (ie: refresh)
   * updated checkout and progress bar to use
     cart value instead of session

TODO:

- validation on email guest entry
- add account creation instructions to an order completion email
- potentially add third prompt for account creation after email (or promos,etc)
- order emails!
- use workflow states to control checkout ui flow.

Thanks to initial contributions from @prinzdezibel!

- use new Accounts collection (previously referred to as customers)
- create account on user create, or use a session specific account
- implement Template.dynamic handling of AddressBook edit/add/grid
- changes to checkout address handling, fix accounts context
- update addressBook forms to autoform-v0.5.0 compatible (autoform not upgraded)
- change accounts/shop `email` from string to `emails` array
  - `emails: {'address': options.email, 'verified': true}`
- changed Shops, Accounts email to an array `emails`
- userAccountsDropdown icon for orders, profile
- user view of order history

TODO:

- merge session accounts to user account upon email confirmation (and email saved on cart)
- reduce / cleanup garbage sessions  (merge will help)
- session / accounts/ cart garbage collector
- account profile / settings
- on account creation / login  with password
    - if confirmed account creation email
      - create a account collection record with this userId
      - update all orders with matching email to match this userId
      - copy all order addresses into Accounts.profile.addressBook
      - copy all social / email info to Accounts.
      - users collection locked down, nothing exposed to client, used for authentication only
    - else
      - if there are more orders with this email
      - display on order view "Add order"

* moves user orders from cart/checkout folder to dashboard/orders
* add message for confirmation of email
* authenticated user can see all orders where userId in list view
* admin can see all in list view
* userAccountsDropdown icon for orders
* add cartId to Orders (instead of using cartId as orderId)

TODO:

- integrate the admin view of list into dashboard admin flow
- this is possibly a breaking change to the orders dashboard.
- remove sessionId from orders on logout

* updates to handling settings from registry (public, private)
* rename and move settingGeneral to shop/settings
* rename and move settingsAccounts to shop/accounts

**Multi-shop/vendor**

* shop account updates to prep multi-shop dashboard
* shopId added to cart.items (variants)

Issue updates:

- Strategic updates for issue #236
- Strategic updates for issue #327

* added settings.public to publish public settings to ReactionCore.xxx

Thanks to contributions and docs from @spencern

- Test coverage for product methods
- Fix, add coverage for core methods

* Upgrade to Meteor 1.0.4.2
* Implements `check` and `audit-argument-checks`
* Implements `browser-policy`
* Fixed footer layout pages loading.
* Updates CFS, removes FileStorage collection.
* **Contributions from @aldeed @prinzdezibel @spencern @boboci9 @evliu @ceh @gouthamve @KEFIRCHIK @epson21 @firstred
**
aaronjudd pushed a commit that referenced this issue Dec 12, 2015
Resolves #76
WIP for Issue #423
- updates reaction-collections
- updates reaction-schemas
@aaronjudd aaronjudd self-assigned this Dec 13, 2015
cmbirk pushed a commit to cmbirk/reaction that referenced this issue Aug 18, 2019
Update kafka-lib, radial-tax and import-tax-codes.
zenweasel pushed a commit that referenced this issue Sep 20, 2022
Don't include `$skip` if value is 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants