mail_engine 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +12 -11
- data/.yardoc/objects/ActionMailer.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/collect_responses_and_parts_order_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/origin_mail_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Base/set_layout_and_partials_i.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector.dat +0 -0
- data/.yardoc/objects/ActionMailer/Collector/custom_i.dat +0 -0
- data/.yardoc/objects/MailEngine.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/acts_as_mail_receiver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/ActsAsMailReceiver/ClassMethods/check_method_existance_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/_40_40configurations.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/current_config_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Base/send_marketing_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration.dat +0 -0
- data/.yardoc/objects/MailEngine/Configuration/load_c.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyMigrations/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources.dat +0 -0
- data/.yardoc/objects/MailEngine/CopyResources/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateConfig/create_config_file_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Engine.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/check_21_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/get_resource_url_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/process_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Install.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/copy_resources_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Install/create_config_i.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber.dat +0 -0
- data/.yardoc/objects/MailEngine/MailLogSubscriber/deliver_i.dat +0 -0
- data/.yardoc/objects/MailEngine/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/ClassMethods/sendgrid_header_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/Base/InstanceMethods.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_3D_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/data_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/FilterSetting/validate_config_21_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/blocks_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/bounces_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/invalidemails_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/spamreports_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApi/stats_c.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/RestApiError.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_sub_val_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/add_to_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/category_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/filters_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/initialize_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/set_unique_args_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_hash_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_json_i.dat +0 -0
- data/.yardoc/objects/MailEngine/Sendgrid/SmtpApi/to_s_i.dat +0 -0
- data/.yardoc/objects/MailEngine/VERSION.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor.dat +0 -0
- data/.yardoc/objects/MailEngine/ZipProcessor/extract_all_files_c.dat +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile +16 -13
- data/Gemfile.lock +69 -46
- data/README.mkd +14 -2
- data/VERSION +1 -1
- data/app/controllers/mail_engine/application_controller.rb +4 -0
- data/app/controllers/mail_engine/mail_logs_controller.rb +1 -1
- data/app/controllers/mail_engine/mail_schedules_controller.rb +4 -4
- data/app/controllers/mail_engine/mail_template_files_controller.rb +4 -4
- data/app/controllers/mail_engine/mail_templates_controller.rb +16 -11
- data/app/controllers/mail_engine/reports_controller.rb +5 -1
- data/app/helpers/mail_engine/mail_engine_helper.rb +1 -1
- data/app/mailers/mail_engine/mail_dispatcher.rb +16 -9
- data/app/models/mail_engine/mail_log.rb +1 -1
- data/app/models/mail_engine/mail_schedule.rb +14 -12
- data/app/models/mail_engine/mail_template.rb +81 -55
- data/app/models/mail_engine/mail_template_file.rb +4 -3
- data/app/views/layouts/mail_engine/mail_engine.html.erb +31 -18
- data/app/views/layouts/mail_engine/simple.html.erb +14 -0
- data/app/views/mail_engine/dashboard/index.html.erb +18 -1
- data/app/views/mail_engine/mail_logs/_related_logs.html.erb +29 -0
- data/app/views/mail_engine/mail_logs/index.html.erb +5 -5
- data/app/views/mail_engine/mail_schedules/_form.html.erb +6 -5
- data/app/views/mail_engine/mail_schedules/index.html.erb +13 -8
- data/app/views/mail_engine/mail_schedules/show.html.erb +2 -0
- data/app/views/mail_engine/mail_template_files/_form.html.erb +20 -10
- data/app/views/mail_engine/mail_template_files/edit.html.erb +2 -0
- data/app/views/mail_engine/mail_template_files/new.html.erb +2 -0
- data/app/views/mail_engine/mail_templates/_form.html.erb +65 -12
- data/app/views/mail_engine/mail_templates/_layout_selector.html.erb +3 -3
- data/app/views/mail_engine/mail_templates/duplicate.html.erb +11 -7
- data/app/views/mail_engine/mail_templates/index.html.erb +25 -21
- data/app/views/mail_engine/mail_templates/new_by_upload.html.erb +11 -5
- data/app/views/mail_engine/mail_templates/partial_options.html.erb +2 -2
- data/app/views/mail_engine/mail_templates/show.html.erb +19 -29
- data/app/views/mail_engine/reports/charts/blocks.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/bounces.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/invalidemails.html.erb +2 -2
- data/app/views/mail_engine/reports/charts/spamreports.html.erb +2 -2
- data/app/views/mail_engine/reports/index.html.erb +40 -5
- data/config/routes.rb +5 -6
- data/db/migrate/20110114030841_create_table_mail_template.rb +1 -0
- data/doc/ActionMailer.html +108 -0
- data/doc/ActionMailer/Base.html +193 -0
- data/doc/ActionMailer/Collector.html +175 -0
- data/doc/MailEngine.html +146 -0
- data/doc/MailEngine/ActsAsMailReceiver.html +97 -0
- data/doc/MailEngine/ActsAsMailReceiver/ClassMethods.html +187 -0
- data/doc/MailEngine/Base.html +297 -0
- data/doc/MailEngine/Configuration.html +181 -0
- data/doc/MailEngine/CopyMigrations.html +187 -0
- data/doc/MailEngine/CopyResources.html +171 -0
- data/doc/MailEngine/CreateConfig.html +193 -0
- data/doc/MailEngine/CreateMigration.html +187 -0
- data/doc/MailEngine/Engine.html +100 -0
- data/doc/MailEngine/HtmlDocumentAssetsReplacer.html +397 -0
- data/doc/MailEngine/Install.html +273 -0
- data/doc/MailEngine/MailLogSubscriber.html +204 -0
- data/doc/MailEngine/Sendgrid.html +101 -0
- data/doc/MailEngine/Sendgrid/Base.html +97 -0
- data/doc/MailEngine/Sendgrid/Base/ClassMethods.html +150 -0
- data/doc/MailEngine/Sendgrid/Base/InstanceMethods.html +81 -0
- data/doc/MailEngine/Sendgrid/FilterSetting.html +257 -0
- data/doc/MailEngine/Sendgrid/RestApi.html +476 -0
- data/doc/MailEngine/Sendgrid/RestApiError.html +100 -0
- data/doc/MailEngine/Sendgrid/SmtpApi.html +604 -0
- data/doc/MailEngine/ZipProcessor.html +267 -0
- data/doc/_index.html +21 -7
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +231 -0
- data/doc/index.html +231 -0
- data/doc/method_list.html +45 -21
- data/doc/top-level-namespace.html +88 -0
- data/lib/mail_engine.rb +7 -1
- data/lib/mail_engine/action_mailer_patch.rb +7 -0
- data/lib/mail_engine/acts_as_mail_receiver.rb +40 -6
- data/lib/mail_engine/base.rb +28 -7
- data/lib/mail_engine/configuration.rb +3 -0
- data/lib/mail_engine/engine.rb +5 -5
- data/lib/mail_engine/generators/{create_migration.rb → copy_migrations.rb} +4 -3
- data/lib/mail_engine/generators/copy_resources.rb +13 -0
- data/lib/mail_engine/generators/install.rb +21 -0
- data/lib/mail_engine/generators/templates/mail_engine_config.yml +10 -1
- data/lib/mail_engine/html_document_assets_replacer.rb +12 -23
- data/lib/mail_engine/mail_log_subscriber.rb +13 -5
- data/lib/mail_engine/zip_processor.rb +10 -1
- data/mail_engine.gemspec +336 -110
- data/public/images/mail_engine/header_and_footer_layout.png +0 -0
- data/public/images/mail_engine/icons/add.png +0 -0
- data/public/images/mail_engine/icons/copy.png +0 -0
- data/public/images/mail_engine/icons/delete.png +0 -0
- data/public/images/mail_engine/icons/edit.gif +0 -0
- data/public/images/mail_engine/icons/missing.png +0 -0
- data/public/images/mail_engine/icons/save.png +0 -0
- data/public/images/mail_engine/icons/show.png +0 -0
- data/public/images/mail_engine/logo.gif +0 -0
- data/public/images/mail_engine/logo.png +0 -0
- data/public/images/mail_engine/none_layout.png +0 -0
- data/public/images/mail_engine/only_footer_layout.png +0 -0
- data/public/images/mail_engine/unselect_header_and_footer_layout.png +0 -0
- data/public/images/mail_engine/unselect_none_layout.png +0 -0
- data/public/images/mail_engine/unselect_only_footer_layout.png +0 -0
- data/public/javascripts/mail_engine/fancybox/blank.gif +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_close.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_loading.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_nav_left.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_nav_right.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_e.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_n.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_ne.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_nw.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_s.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_se.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_sw.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_shadow_w.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_left.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_main.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_over.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancy_title_right.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox-x.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox-y.png +0 -0
- data/public/javascripts/mail_engine/fancybox/fancybox.png +0 -0
- data/public/javascripts/mail_engine/fancybox/jquery.easing-1.3.pack.js +72 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.css +359 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.js +1156 -0
- data/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
- data/public/javascripts/mail_engine/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
- data/public/javascripts/mail_engine/jquery-ui.min.js +577 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/jquery.iframe-auto-height.plugin.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/jquery.string.js +0 -0
- data/{test/dummy/public/javascripts/mail_engine_application.js → public/javascripts/mail_engine/mail_engine.js} +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/jquery.markitup.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/css.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/tag.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_center.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_justify.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_left.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_align_right.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_indent.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_letterspacing.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_linespacing.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_lowercase.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_bottom.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_left.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_right.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_padding_top.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/images/text_uppercase.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/readme.txt +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/css/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/clean.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/image.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/link.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/preview.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/default/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/bold.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/clean.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h1.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h2.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h3.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h4.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h5.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/h6.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/image.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/italic.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/link.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-bullet.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-item.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/list-numeric.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/paragraph.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/picture.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/preview.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/images/stroke.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/readme.txt +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/set.js +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/sets/html/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-container.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/handle.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/menu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/images/submenu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/markitup/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/handle.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/menu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/images/submenu.png +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/skins/simple/style.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/templates/preview.css +0 -0
- data/{test/dummy/public/javascripts → public/javascripts/mail_engine}/markitup/templates/preview.html +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/mail_engine/jquery-ui/smoothness/jquery-ui.css +544 -0
- data/{test/dummy/public/stylesheets → public/stylesheets/mail_engine}/style.css +6 -2
- data/test/dummy/app/controllers/application_controller.rb +0 -8
- data/test/dummy/app/models/user.rb +6 -4
- data/test/dummy/config/application.rb +2 -2
- data/test/dummy/config/database.yml +2 -2
- data/test/dummy/db/migrate/20110114030841_create_table_mail_template.rb +1 -0
- data/test/dummy/db/migrate/20110206025002_create_mail_logs.rb +1 -1
- data/test/dummy/db/schema.rb +1 -0
- data/test/dummy/public/images/mail_engine/icons/add.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/copy.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/delete.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/edit.gif +0 -0
- data/test/dummy/public/images/mail_engine/icons/missing.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/save.png +0 -0
- data/test/dummy/public/images/mail_engine/icons/show.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/blank.gif +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_close.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_loading.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_nav_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_nav_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_e.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_n.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_ne.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_nw.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_s.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_se.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_sw.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_shadow_w.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_main.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_over.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancy_title_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox-x.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox-y.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/fancybox.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.easing-1.3.pack.js +72 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.css +359 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.js +1156 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
- data/test/dummy/public/javascripts/mail_engine/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
- data/test/dummy/public/javascripts/mail_engine/jquery-ui.min.js +577 -0
- data/test/dummy/public/javascripts/mail_engine/jquery.iframe-auto-height.plugin.js +50 -0
- data/test/dummy/public/javascripts/mail_engine/jquery.string.js +425 -0
- data/test/dummy/public/javascripts/mail_engine/mail_engine.js +2 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/jquery.markitup.js +564 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/css.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/tag.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_center.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_justify.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_align_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_indent.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_letterspacing.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_linespacing.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_lowercase.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_bottom.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_left.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_right.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_padding_top.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/images/text_uppercase.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/readme.txt +28 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/set.js +52 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/css/style.css +72 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/clean.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/image.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/link.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/preview.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/set.js +27 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/default/style.css +27 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/bold.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/clean.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h1.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h2.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h3.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h4.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h5.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/h6.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/image.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/italic.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/link.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-bullet.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-item.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/list-numeric.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/paragraph.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/picture.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/preview.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/images/stroke.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/readme.txt +11 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/set.js +40 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/sets/html/style.css +59 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-container.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-html.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-json.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/bg-editor.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/handle.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/menu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/markitup/style.css +147 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/handle.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/menu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/images/submenu.png +0 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/skins/simple/style.css +118 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/templates/preview.css +5 -0
- data/test/dummy/public/javascripts/mail_engine/markitup/templates/preview.html +11 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/dummy/public/stylesheets/mail_engine/jquery-ui/smoothness/jquery-ui.css +544 -0
- data/test/dummy/public/stylesheets/mail_engine/style.css +685 -0
- data/test/factories.rb +31 -4
- data/test/functional/mail_engine/{mail_schedules_controller_controller_test.rb → dashboard_controller_test.rb} +2 -2
- data/test/functional/mail_engine/{mail_templates_controller_controller_test.rb → mail_logs_controller_test.rb} +2 -2
- data/test/functional/mail_engine/mail_schedules_controller_test.rb +8 -0
- data/test/functional/mail_engine/mail_template_files_controller_test.rb +8 -0
- data/test/functional/mail_engine/mail_templates_controller_test.rb +8 -0
- data/test/functional/mail_engine/reports_controller_test.rb +8 -0
- data/test/functional/user_mailer_test.rb +14 -0
- data/test/test_helper.rb +4 -1
- data/test/unit/mail_engine/mail_log_test.rb +1 -1
- data/test/unit/mail_engine/mail_schedule_test.rb +34 -1
- data/test/unit/mail_engine/mail_template_test.rb +51 -12
- data/test/unit/user_test.rb +20 -0
- metadata +370 -125
- data/.yardoc/objects/MailEngine/Base/send_mail_c.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration.dat +0 -0
- data/.yardoc/objects/MailEngine/CreateMigration/create_migrations_i.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_filename_in_html_c.dat +0 -0
- data/.yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_url_in_html_c.dat +0 -0
- data/.yardoc/objects/PLACEHOLDERS_IN_LAYOUT.dat +0 -0
- data/lib/mail_engine/placeholders_in_layout.rb +0 -5
- data/test/dummy/public/javascripts/jquery.nyroModal/img/ajaxLoader.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/close.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/next.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/img/prev.gif +0 -0
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal-ie6.js +0 -186
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal-ie6.min.js +0 -9
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.js +0 -1599
- data/test/dummy/public/javascripts/jquery.nyroModal/js/jquery.nyroModal.custom.min.js +0 -34
- data/test/dummy/public/javascripts/jquery.nyroModal/styles/nyroModal.css +0 -102
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
data/README.mkd
CHANGED
@@ -12,7 +12,7 @@ integration configuration to take advantage that system. (More information at ht
|
|
12
12
|
6. Allow logging all sent mails, you can check which mail been sent to which user.
|
13
13
|
7. You can know send the email to the active users, so that you don't need to waste your credits of sendgrid or amazon.
|
14
14
|
|
15
|
-
Problem when using third
|
15
|
+
Problem when using third party mail system
|
16
16
|
=========================================
|
17
17
|
We are using mailchimp mostly for the newsletter solution, but it's has many problems that we have to make a new mail engine
|
18
18
|
to fit our needs in real project:
|
@@ -33,6 +33,18 @@ Installation
|
|
33
33
|
|
34
34
|
** Step 2: **
|
35
35
|
|
36
|
+
Add management page needed javascript lib and css files, migration files and mail_engine_config.yml under config directory.
|
37
|
+
|
38
|
+
rails g mail_engine:install
|
39
|
+
|
40
|
+
** Step 3: **
|
41
|
+
|
42
|
+
Run migration.
|
43
|
+
|
44
|
+
rake db:migrate
|
45
|
+
|
46
|
+
** Step 4: **
|
47
|
+
|
36
48
|
Add below line to the crontab list of your sever:
|
37
49
|
|
38
50
|
### check mail schedule for every 15 minutes ###
|
@@ -51,7 +63,7 @@ Mail Engine use Liquid template engine, so you can read the Liquid Reference at
|
|
51
63
|
|
52
64
|
Steps:
|
53
65
|
|
54
|
-
1.
|
66
|
+
1. Create a template in mail engine.
|
55
67
|
|
56
68
|
** For Marketing Mail: **
|
57
69
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -4,4 +4,8 @@ class MailEngine::ApplicationController < ActionController::Base
|
|
4
4
|
layout 'mail_engine/mail_engine'
|
5
5
|
include MailEngine
|
6
6
|
helper MailEngine::MailEngineHelper
|
7
|
+
|
8
|
+
def close_modal_and_refresh
|
9
|
+
render :text => "<script>parent.$.fancybox.close();parent.window.location.reload();</script>"
|
10
|
+
end
|
7
11
|
end
|
@@ -2,7 +2,7 @@ class MailEngine::MailLogsController < MailEngine::ApplicationController
|
|
2
2
|
before_filter :find_model
|
3
3
|
|
4
4
|
def index
|
5
|
-
@mail_logs = MailLog.order("created_at desc").
|
5
|
+
@mail_logs = MailLog.order("created_at desc").page(params[:page]).per(20)
|
6
6
|
end
|
7
7
|
|
8
8
|
def show
|
@@ -2,7 +2,7 @@ class MailEngine::MailSchedulesController < MailEngine::ApplicationController
|
|
2
2
|
before_filter :find_model
|
3
3
|
|
4
4
|
def index
|
5
|
-
@mail_schedules = MailSchedule.
|
5
|
+
@mail_schedules = MailSchedule.order("created_at desc").page(params[:page]).per(20)
|
6
6
|
end
|
7
7
|
|
8
8
|
def show
|
@@ -43,10 +43,10 @@ class MailEngine::MailSchedulesController < MailEngine::ApplicationController
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def send_test_mail
|
46
|
-
@mail_schedule.send_test_mail_to!(params[:recipient])
|
47
|
-
render :text =>
|
46
|
+
@mail_schedule.send_test_mail_to!(params[:recipient], params[:sample_user_id])
|
47
|
+
render :text => %Q{alert("Test Mail sent to #{params[:recipient]}"); $('#recipient').val('');}
|
48
48
|
rescue => e
|
49
|
-
render :text =>
|
49
|
+
render :text => %Q{alert("Test Mail failed to send to #{params[:recipient]}, due to #{e.to_s}"); $('#recipient').val('');}
|
50
50
|
end
|
51
51
|
|
52
52
|
private
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class MailEngine::MailTemplateFilesController < MailEngine::ApplicationController
|
2
|
-
layout
|
2
|
+
layout "mail_engine/simple"
|
3
3
|
before_filter :find_model
|
4
4
|
|
5
5
|
def index
|
@@ -10,9 +10,9 @@ class MailEngine::MailTemplateFilesController < MailEngine::ApplicationControlle
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def create
|
13
|
-
@mail_template_file = @mail_template.mail_template_files.
|
13
|
+
@mail_template_file = @mail_template.mail_template_files.build(params[:mail_engine_mail_template_file])
|
14
14
|
if @mail_template_file.save
|
15
|
-
|
15
|
+
close_modal_and_refresh
|
16
16
|
else
|
17
17
|
render :new
|
18
18
|
end
|
@@ -23,7 +23,7 @@ class MailEngine::MailTemplateFilesController < MailEngine::ApplicationControlle
|
|
23
23
|
|
24
24
|
def update
|
25
25
|
if @mail_template_file.update_attributes(params[:mail_engine_mail_template_file])
|
26
|
-
|
26
|
+
close_modal_and_refresh
|
27
27
|
else
|
28
28
|
render :edit
|
29
29
|
end
|
@@ -14,7 +14,7 @@ class MailEngine::MailTemplatesController < MailEngine::ApplicationController
|
|
14
14
|
return
|
15
15
|
end
|
16
16
|
|
17
|
-
@mail_templates = @mail_templates.group("path").
|
17
|
+
@mail_templates = @mail_templates.group("path").page(params[:page]).per(20)
|
18
18
|
end
|
19
19
|
|
20
20
|
def show
|
@@ -47,14 +47,14 @@ class MailEngine::MailTemplatesController < MailEngine::ApplicationController
|
|
47
47
|
if request.put?
|
48
48
|
@duplicated_mail_template = @mail_template.duplicate(params[:mail_engine_mail_template])
|
49
49
|
if @duplicated_mail_template.errors.blank?
|
50
|
-
|
50
|
+
close_modal_and_refresh
|
51
51
|
return
|
52
52
|
end
|
53
53
|
else
|
54
54
|
@duplicated_mail_template = @mail_template
|
55
55
|
end
|
56
56
|
|
57
|
-
render :layout =>
|
57
|
+
render :layout => "mail_engine/simple"
|
58
58
|
end
|
59
59
|
|
60
60
|
def destroy
|
@@ -76,7 +76,12 @@ class MailEngine::MailTemplatesController < MailEngine::ApplicationController
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def new
|
79
|
-
@mail_template = MailTemplate.new :layout => 'none'
|
79
|
+
@mail_template = MailTemplate.new :layout => 'none', :partial => params[:type] == 'partial'
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_existed_subject
|
83
|
+
subject = MailTemplate.get_subject_from_bother_template(params[:path], params[:locale], params[:for_marketing] == 'true')
|
84
|
+
render :text => %Q{#{subject}}
|
80
85
|
end
|
81
86
|
|
82
87
|
def new_by_upload
|
@@ -118,7 +123,7 @@ class MailEngine::MailTemplatesController < MailEngine::ApplicationController
|
|
118
123
|
|
119
124
|
def update
|
120
125
|
if @mail_template.update_attributes(params[:mail_engine_mail_template])
|
121
|
-
redirect_to mail_template_path(@mail_template), :notice => 'Mail template was successfully
|
126
|
+
redirect_to mail_template_path(@mail_template), :notice => 'Mail template was successfully updated.'
|
122
127
|
else
|
123
128
|
render "edit"
|
124
129
|
end
|
@@ -127,12 +132,12 @@ class MailEngine::MailTemplatesController < MailEngine::ApplicationController
|
|
127
132
|
def edit
|
128
133
|
end
|
129
134
|
|
130
|
-
def send_test_mail
|
131
|
-
|
132
|
-
|
133
|
-
rescue => e
|
134
|
-
|
135
|
-
end
|
135
|
+
# def send_test_mail
|
136
|
+
# @mail_template.send_test_mail_to!(params[:recipient])
|
137
|
+
# render :text => "alert('Test Mail sent to #{params[:recipient]}'); $('#recipient').val('');"
|
138
|
+
# rescue => e
|
139
|
+
# render :text => "alert(\"Test Mail failed to send to #{params[:recipient]}, due to #{e.to_s}\"); $('#recipient').val('');"
|
140
|
+
# end
|
136
141
|
|
137
142
|
private
|
138
143
|
def find_model
|
@@ -18,7 +18,11 @@ class MailEngine::ReportsController < MailEngine::ApplicationController
|
|
18
18
|
"repeat_unsubscribes"
|
19
19
|
]
|
20
20
|
|
21
|
-
@stats_data =
|
21
|
+
@stats_data = if params[:report] and params[:report][:from] and params[:report][:to]
|
22
|
+
MailEngine::Sendgrid::RestApi.stats(:start_date => params[:report][:from], :end_date => params[:report][:to])
|
23
|
+
else
|
24
|
+
MailEngine::Sendgrid::RestApi.stats(:days => 6)
|
25
|
+
end
|
22
26
|
@data_of_today = @stats_data.last
|
23
27
|
end
|
24
28
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class MailEngine::MailDispatcher < ActionMailer::Base
|
2
2
|
default :from => "info@itjob.fm"
|
3
3
|
sendgrid_header do
|
4
|
-
category "
|
4
|
+
category MailEngine::Base.current_config["sendgrid_category"]
|
5
5
|
|
6
6
|
filters {
|
7
7
|
opentrack "enable" => 1
|
@@ -14,26 +14,33 @@ class MailEngine::MailDispatcher < ActionMailer::Base
|
|
14
14
|
|
15
15
|
protected
|
16
16
|
|
17
|
+
###
|
18
|
+
# MailEngine::MailDispatcher.{any template name}(
|
19
|
+
# :subject => 'hello',
|
20
|
+
# :to => 'm@theplant.jp',
|
21
|
+
# :values => {:username => @user.name}
|
22
|
+
# ).deliver
|
23
|
+
#
|
17
24
|
def self.method_missing(method, *args)
|
18
25
|
return super if respond_to?(method) # basically it won't unless subclass
|
19
26
|
|
27
|
+
options = args.dup.extract_options!
|
28
|
+
options[:locale] ||= I18n.locale
|
29
|
+
|
20
30
|
# TODO if template file exists, don't need to exam the db.
|
21
|
-
templates = MailEngine::MailTemplate.where(:path => method).order('format desc').all
|
31
|
+
templates = MailEngine::MailTemplate.where(:path => method, :locale => options[:locale], :for_marketing => true, :partial => false).order('format desc').all
|
22
32
|
raise "No Template added." if templates.blank?
|
23
33
|
|
34
|
+
subject = templates.first.subject
|
24
35
|
formats = templates.map {|t| "format.#{t.format}" }.sort.reverse
|
25
36
|
|
26
|
-
|
27
|
-
# MailEngine::MailDispatcher.{any template name}(
|
28
|
-
# :subject => 'hello',
|
29
|
-
# :to => 'm@theplant.jp',
|
30
|
-
# :values => {:username => @user.name}
|
31
|
-
# ).deliver
|
32
|
-
#
|
37
|
+
# generate the method for db template.
|
33
38
|
class_eval <<-METHOD
|
34
39
|
def #{method} options
|
35
40
|
### extract mail options, used for mail method.
|
36
41
|
mail_options = {}
|
42
|
+
mail_options[:subject] = "#{%Q{#{subject}}}"
|
43
|
+
|
37
44
|
options.delete_if {|key, value|
|
38
45
|
if [:subject, :to, :from, :cc, :bcc, :reply_to, :date].include?(key.to_sym)
|
39
46
|
mail_options[key] = value
|
@@ -1,9 +1,14 @@
|
|
1
1
|
class MailEngine::MailSchedule < ActiveRecord::Base
|
2
2
|
validates_presence_of :name, :user_group, :mail_template_id, :period, :count, :first_send_at
|
3
3
|
belongs_to :mail_template
|
4
|
-
|
5
4
|
scope :available, where("sent_count < count OR count = 0")
|
6
5
|
|
6
|
+
# list mail log with the same mail_template_path to current mail_template's path
|
7
|
+
def logs(count = 10)
|
8
|
+
MailEngine::MailLog.where(:mail_template_path => self.mail_template.actual_path).order("id desc").limit(count)
|
9
|
+
end
|
10
|
+
|
11
|
+
# load user info into payload hash used at mail template.
|
7
12
|
def load_payload user
|
8
13
|
payload_hash = {}
|
9
14
|
self.payload.split(",").each do |col|
|
@@ -12,17 +17,13 @@ class MailEngine::MailSchedule < ActiveRecord::Base
|
|
12
17
|
payload_hash
|
13
18
|
end
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
# send test mail to specific recipient email address, with loading sample_user's data.
|
21
|
+
def send_test_mail_to!(recipient, sample_user_id)
|
22
|
+
raise "Wrong email format." if recipient.blank? or recipient !~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
|
23
|
+
sample_user = MailEngine::USER_MODEL.find(sample_user_id)
|
19
24
|
|
20
25
|
I18n.with_locale(mail_template.locale) do
|
21
|
-
MailEngine::MailDispatcher.send(
|
22
|
-
mail_template.template_name.to_sym,
|
23
|
-
:to => recipient,
|
24
|
-
:values => self.load_payload(sample_user)
|
25
|
-
).deliver
|
26
|
+
MailEngine::MailDispatcher.send( mail_template.template_name.to_sym, :to => recipient, :values => self.load_payload(sample_user) ).deliver
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
@@ -50,15 +51,16 @@ class MailEngine::MailSchedule < ActiveRecord::Base
|
|
50
51
|
ready_to_send or (not_sent_mail_within_15_minutes and result_by_period)
|
51
52
|
end
|
52
53
|
|
54
|
+
# used in Rake task, the main mail sending method.
|
53
55
|
def sendmail
|
54
|
-
puts "---> Schedule: '#{self.name}'"
|
56
|
+
puts "---> Schedule: '#{self.name}'" if Rails.env != 'test'
|
55
57
|
|
56
58
|
unless ready_to_send?
|
57
59
|
puts "---> not ready"
|
58
60
|
return false
|
59
61
|
end
|
60
62
|
|
61
|
-
|
63
|
+
MailEngine::USER_MODEL.send(self.user_group.to_sym).each do |user|
|
62
64
|
puts "-> sending mail to #{user.email}"
|
63
65
|
MailEngine::MailDispatcher.send(mail_template.template_name.to_sym, :to => user.email, :values => self.load_payload(user) ).deliver
|
64
66
|
end
|
@@ -4,19 +4,20 @@ class MailEngine::MailTemplate < ActiveRecord::Base
|
|
4
4
|
mount_uploader :zip_file, MailEngine::ZipFileUploader
|
5
5
|
|
6
6
|
validates :name, :path, :presence => true
|
7
|
+
validates :subject, :presence => true, :if => Proc.new { |template| !template.partial? }
|
7
8
|
validates :locale, :inclusion => I18n.available_locales.map(&:to_s)
|
8
9
|
validates :format, :inclusion => Mime::SET.symbols.map(&:to_s)
|
9
10
|
validates :layout, :presence => true, :if => Proc.new {|template| !template.partial? }
|
10
11
|
validates :body, :presence => true, :if => Proc.new {|template| template.create_by_upload.blank? }
|
11
12
|
validates :zip_file, :presence => true, :if => Proc.new {|template| template.create_by_upload.present? }
|
12
13
|
validates :path, :format => { :with => /([^\/]+\/)+/i, :message => "path should looks like 'controller/action'" }, :if => Proc.new { |template| !template.for_marketing? }
|
14
|
+
validates :path, :format => { :with => /^[a-z\_]+$/i, :message => "path should be consisted of english character and underscore." }, :if => Proc.new { |template| template.for_marketing? }
|
13
15
|
# validates :handler, :inclusion => ActionView::Template::Handlers.extensions.map(&:to_s)
|
14
16
|
validates_uniqueness_of :path, :scope => [:locale, :handler, :format, :partial]
|
15
|
-
|
16
17
|
after_validation :check_placeholders_for_layout
|
17
18
|
before_validation :check_zip_file, :if => Proc.new {|template| template.create_by_upload.present? }
|
18
19
|
|
19
|
-
has_many :mail_schedules
|
20
|
+
has_many :mail_schedules, :dependent => :nullify
|
20
21
|
has_many :template_partials, :dependent => :destroy
|
21
22
|
has_many :partials, :through => :template_partials
|
22
23
|
has_many :mail_template_files
|
@@ -34,25 +35,53 @@ class MailEngine::MailTemplate < ActiveRecord::Base
|
|
34
35
|
|
35
36
|
after_create :process_zip_file
|
36
37
|
before_save :delete_partials_if_new_partials_added
|
37
|
-
|
38
38
|
after_save do
|
39
|
-
|
39
|
+
# clear cached paths
|
40
|
+
MailEngine::MailTemplate::Resolver.instance.clear_cache
|
41
|
+
|
42
|
+
# update subject
|
43
|
+
MailEngine::MailTemplate.update_all(["subject=?", self.subject], ["path = ? AND locale = ?", self.path, self.locale])
|
44
|
+
end
|
45
|
+
|
46
|
+
# class methods
|
47
|
+
class << self
|
48
|
+
def get_subject_from_bother_template(path, locale, for_marketing)
|
49
|
+
return nil if path.blank?
|
50
|
+
MailEngine::MailTemplate.where(:path => path, :locale => locale, :for_marketing => for_marketing, :partial => false).select("subject").first.try(:subject)
|
51
|
+
end
|
40
52
|
end
|
41
53
|
|
54
|
+
# detect if current partial template is used by other templates.
|
42
55
|
def partial_in_use?
|
43
56
|
self.partial? and self.mail_templates.count > 0
|
44
57
|
end
|
45
58
|
|
59
|
+
# list the templates with same path, but different locale and format
|
46
60
|
def variations
|
47
|
-
self.class.where(:path => self.path).order("locale, format")
|
61
|
+
existed_variations = self.class.where(:path => self.path, :partial => false).order("locale, format")
|
62
|
+
|
63
|
+
all_variation_codes = I18n.available_locales.product([:html, :text])
|
64
|
+
existed_variation_codes = existed_variations.map do |template|
|
65
|
+
[template.locale.to_sym, template.format.to_sym]
|
66
|
+
end
|
67
|
+
missing_variations = (all_variation_codes - existed_variation_codes).map do |locale, format|
|
68
|
+
MailEngine::MailTemplate.new :locale => locale.to_s, :format => format.to_s
|
69
|
+
end
|
70
|
+
|
71
|
+
missing_variations + existed_variations
|
72
|
+
end
|
73
|
+
|
74
|
+
def actual_path
|
75
|
+
return "mail_engine/mail_dispatcher/#{self.path}" if self.for_marketing?
|
76
|
+
self.path
|
48
77
|
end
|
49
78
|
|
50
79
|
# has_many :logs, :class_name => "MailEngine::MailLog", :conditions => {:mail_template_path => self.path}
|
51
80
|
def logs
|
52
|
-
MailEngine::MailLog.where(:mail_template_path => self.
|
81
|
+
MailEngine::MailLog.where(:mail_template_path => self.actual_path).order("id desc").limit(10)
|
53
82
|
end
|
54
83
|
|
55
|
-
#
|
84
|
+
# FIXME: if no changes just keep the same, it sill will remove the template partial and add a new one
|
56
85
|
def delete_partials_if_new_partials_added
|
57
86
|
if self.template_partials.detect {|tmp| !tmp.persisted? }.present? || self.layout == 'none' # has new partials selected
|
58
87
|
MailEngine::TemplatePartial.destroy_all(:mail_template_id => self) # remove previous partials
|
@@ -115,6 +144,7 @@ class MailEngine::MailTemplate < ActiveRecord::Base
|
|
115
144
|
return 'marketing' if self.for_marketing?
|
116
145
|
end
|
117
146
|
|
147
|
+
# controller/action_name => for get the action_name
|
118
148
|
def template_name
|
119
149
|
self.path.scan(/[^\/]+$/).first
|
120
150
|
end
|
@@ -133,23 +163,16 @@ class MailEngine::MailTemplate < ActiveRecord::Base
|
|
133
163
|
"#{filename}.#{self.locale}.#{self.format}.#{self.handler}"
|
134
164
|
end
|
135
165
|
|
136
|
-
# return one clone version of self
|
166
|
+
# return one clone version of self with all duplicated relations.
|
137
167
|
def duplicate merge_options = {}
|
138
|
-
### create dictionary for custom cloning file object.
|
139
|
-
# dict = { :mail_template_files => {} }
|
140
|
-
# self.mail_template_files.each{ |f|
|
141
|
-
# clone_file = f.clone
|
142
|
-
# clone_file.file = File.open(f.file.path)
|
143
|
-
# dict[:mail_template_files][f] = clone_file
|
144
|
-
# }
|
145
|
-
|
146
168
|
# start to clone
|
147
169
|
duplicated_obj = self.clone :except => [:zip_file], :include => [:template_partials, :mail_template_files]
|
148
|
-
duplicated_obj.zip_file = File.open(self.zip_file.path) if self.zip_file.path
|
149
|
-
duplicated_obj.attributes = merge_options if merge_options.is_a? Hash
|
170
|
+
duplicated_obj.zip_file = File.open(self.zip_file.path) if self.zip_file.path # it will make a copy version of zipfile
|
171
|
+
duplicated_obj.attributes = merge_options if merge_options.is_a? Hash # merge custom options
|
150
172
|
# without saving can't not create files. so save it first.
|
151
173
|
duplicated_obj.save
|
152
174
|
|
175
|
+
### below code is used to clone mail_template_files and replace the new url for cloned template body.
|
153
176
|
# pair the mail_template_files and insert into substitution_array.
|
154
177
|
substitution_pair_array = []
|
155
178
|
self.mail_template_files.each_with_index do |origin_file, index|
|
@@ -160,52 +183,55 @@ class MailEngine::MailTemplate < ActiveRecord::Base
|
|
160
183
|
original_body = self.body
|
161
184
|
|
162
185
|
substitution_pair_array.each do |origin_file, new_file|
|
163
|
-
original_body = MailEngine::HtmlDocumentAssetsReplacer.
|
186
|
+
original_body = MailEngine::HtmlDocumentAssetsReplacer.replace_resource_in_html(
|
164
187
|
original_body,
|
165
188
|
origin_file.file.url,
|
166
|
-
new_file.file.url
|
189
|
+
new_file.file.url,
|
190
|
+
:url
|
167
191
|
)
|
168
192
|
end
|
169
193
|
|
170
|
-
#
|
194
|
+
# write back the new body with cloned resource urls.
|
171
195
|
duplicated_obj.update_attributes :body => original_body
|
172
196
|
duplicated_obj
|
173
197
|
end
|
174
198
|
|
175
|
-
def send_test_mail_to!(recipient)
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
199
|
+
# def send_test_mail_to!(recipient)
|
200
|
+
# # raise "Wrong email format." if recipient.blank? or recipient !~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
|
201
|
+
# raise "Can not find any user." if (sample_user = MailEngine::USER_MODEL.first).blank?
|
202
|
+
#
|
203
|
+
# ### 3 conditions
|
204
|
+
# # 1. action - marketing mail only have one action
|
205
|
+
# # 2. controler/action
|
206
|
+
# # 3. namespace/namespace/controller/action
|
207
|
+
# #
|
208
|
+
# path_sections = self.path.split("/")
|
209
|
+
#
|
210
|
+
# # marketing mail
|
211
|
+
# if self.for_marketing?
|
212
|
+
# action_name = path_sections.last
|
213
|
+
# mailer_class_name = "MailEngine::MailDispatcher"
|
214
|
+
# else
|
215
|
+
# mailer_name = path_sections[-2]
|
216
|
+
# action_name = path_sections[-1]
|
217
|
+
# namespaces = path_sections - Array.wrap(path_sections[-2..-1])
|
218
|
+
#
|
219
|
+
# if namespaces.present?
|
220
|
+
# mailer_class_name = namespaces.map(&:classify).join("::")
|
221
|
+
# mailer_class_name += "::#{mailer_name.classify}"
|
222
|
+
# else
|
223
|
+
# mailer_class_name = "#{mailer_name.classify}"
|
224
|
+
# end
|
225
|
+
# end
|
226
|
+
#
|
227
|
+
# # send mail.
|
228
|
+
# I18n.with_locale(self.locale) do
|
229
|
+
# mailer_class_name.constantize.send(
|
230
|
+
# action_name.to_sym,
|
231
|
+
# :to => recipient
|
232
|
+
# ).deliver
|
233
|
+
# end
|
234
|
+
# end
|
209
235
|
|
210
236
|
|
211
237
|
###############################
|