view · edit · sidebar · attach · print · history

20130723-add-error-message-to-form-on-davaz-com-debug-smtp-error-on-vetoquinol

<< | Index | >>


Summary

  • Update news form of davaz.com
  • Debug SMTP Temporary Error on vetoquinol.

Commits / Patches

Index / Status


Update textfield

Some textfields are not WYSIWYG Editor.

Expected

<div class="block-image">
<div dojoattachpoint="inputContainer" style="" widgetid="ywesee_widget_InputTextarea_0">
<div class="label" dojoattachpoint="labelDiv"> </div>
<div class="block-text live-edit" dojoattachpoint="inputDiv">
<form class="live-edit-form" method="POST" accept-charset="UTF-8" dojoattachevent="onsubmit: saveChanges" dojoattachpoint="inputForm">

compose

[["update_url", "http://davaz.yasuhiro.ch/en/admin/ajax_save_live_edit/"], ["delete_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/cancel.png"], ["delete_icon_txt", "Delete Item"], ["delete_image_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/delete.png"], ["delete_image_icon_txt", "Delete Image"], ["add_image_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/add.png"], ["add_image_icon_txt", "Add Image"], ["delete_item_url", "http://davaz.yasuhiro.ch/en/communication/ajax_delete_element/artobject_id/1037"], ["delete_image_url", "http://davaz.yasuhiro.ch/en/communication/ajax_delete_image/artobject_id/1037"], ["upload_form_url", "http://davaz.yasuhiro.ch/en/communication/ajax_upload_image_form/artobject_id/1037"], ["has_image", "true"], ["image_url", "/resources/uploads/images/7/1037.jpeg?time=1374033211"]]

But

<div class="label" dojoattachpoint="labelDiv"> </div>
<div class="block-text live-edit" dojoattachpoint="inputDiv">
<form class="live-edit-form" method="POST" accept-charset="UTF-8" dojoattachevent="onsubmit: saveChanges" dojoattachpoint="inputForm">

compose is same

[["update_url", "http://davaz.yasuhiro.ch/en/admin/ajax_save_live_edit/"], ["delete_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/cancel.png"], ["delete_icon_txt", "Delete Item"], ["delete_image_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/delete.png"], ["delete_image_icon_txt", "Delete Image"], ["add_image_icon_src", "http://davaz.yasuhiro.ch/resources/images/global/icons/add.png"], ["add_image_icon_txt", "Add Image"], ["delete_item_url", "http://davaz.yasuhiro.ch/en/communication/ajax_delete_element/artobject_id/1340"], ["delete_image_url", "http://davaz.yasuhiro.ch/en/communication/ajax_delete_image/artobject_id/1340"], ["upload_form_url", "http://davaz.yasuhiro.ch/en/communication/ajax_upload_image_form/artobject_id/1340"], ["has_image", "false"]]
commit

Create Error message for require fields

state.rb in :sbsm:

    def mandatory_violation(value)
      value.nil? || (value.respond_to?(:empty?) && value.empty?)
    end 

State recognize missing_field.

:debug on State#error_check_and_store

2013-07-23 11:21:14.605092500 :serie_position #=> key
2013-07-23 11:21:14.605172500 true # => mandatory.include?(key)
2013-07-23 11:21:14.605251500 true # => mandatory_violation(value)
2013-07-23 11:21:14.553003500 
2013-07-23 11:21:14.553007500 #<SBSM::ProcessingError: e_missing_fields> # => error

But I could not add error in view, this redirects after POST.
Then I Added red style for require fields.

commit

Debug SMTP Error on vetoquinol.bbmb.ch

SMTP::Error (Net::SMTPServerBusy)

SMTP Error 420 or 450

450 	Requested mail action not taken: mailbox unavailable
link

send_order has 3 mail sendings.

  • TargetDir#send_order
  • Mail#send_order #=> fails
  • Mail#send_confirmation
lib/bbmb/util/server.rb
      def send_order order, customer
        begin
          Timeout.timeout(300) {
            BBMB::Util::TargetDir.send_order(order)
          }   
        rescue StandardError => err 
          err.message << " (Email: #{customer.email} - Customer-Id: #{customer.customer_id})"
          BBMB::Util::Mail.notify_error(err)
        end 
        begin
          Timeout.timeout(300) {
            BBMB::Util::Mail.send_order(order)
          }   
        rescue StandardError => err 
          err.message << " (Email: #{customer.email} - Customer-Id: #{customer.customer_id})"
          BBMB::Util::Mail.notify_error(err)
        end 
        begin
          Timeout.timeout(300) {
            BBMB::Util::Mail.send_confirmation(order)
          }   
        rescue StandardError => err 
          err.message << " (Email: #{customer.email} - Customer-Id: #{customer.customer_id})"
          BBMB::Util::Mail.notify_error(err)
        end
      end
lib/bbmb/util/mail.rb
  def Mail.send_order(order)
    header, message = setup
    config = BBMB.config
    from = header.from = config.mail_order_from
    to = header.to = config.mail_order_to
    cc = header.cc = config.mail_order_cc
    header.subject = config.mail_order_subject % order.order_id
    header.add('Message-ID', sprintf('<%s@%s>', order.order_id, 
                                     from.tr('@', '.')))
    message.body = order.to_target_format

    Mail.sendmail(message, from, to, cc) 
  end
view · edit · sidebar · attach · print · history
Page last modified on July 23, 2013, at 08:20 AM