Skip to content

Add some system for telling the developer to fix certain things in their emails #93

Open
@Mange

Description

@Mange

Roadie should have some form of reporting system where it can scan an email for bad patterns and tell the user about it.

Suggestions for "warnings":

  1. Report on invalid URLs
  2. Warn about <form>, etc. in the email

Reporting should be transparent and optional. Ideas on implementation:

  • Test modules. Include them, run the assertions on the email.
    • This would be better served with another gem, right? roadie-doctor or something crazy like that..?
    • Doesn't help with detecting problems in production, where dynamic helpers might've ruined something that would appear okay in test.
  • Callback for both enabling and for handling problems.
    • Makes it very optional. Sadly, also a bit of a threshold to climb to enable it.
    • See code sample 1 below.
  • Store it on Document, when enabled.
    • Easier to enable and you can report it however you want afterwards. Might be more useful for more people since it's possible to send all of them in a single message.
    • See code sample 2 below.
# Sample 1
unless RACK_ENV == "production"
  document.report_problems = ->(error, doc) {
    My.logger.warn error
  }
end

# Sample 2
document.report_problems = true
html = document.transform
document.problems #=> [#<Roadie::Problem "Invalid URL: ...">]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions