{"record":{"id":"852aa5241979d68a","repo":"padrino/padrino-framework","slug":"mailer-mailer-name-has-no-message-message","errorCode":null,"errorMessage":"mailer '#{mailer_name}' has no message '#{message_name}'","messagePattern":"mailer '#(.+?)' has no message '#(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"padrino-mailer/lib/padrino-mailer/helpers.rb","lineNumber":110,"sourceCode":"        alias mailers mailer\n\n        ##\n        # Delivers a mailer message email with the given attributes.\n        #\n        # @param [Symbol] mailer_name\n        #   The name of the mailer.\n        # @param [Symbol] message_name\n        #   The name of the message to deliver.\n        # @param attributes\n        #   The parameters to pass to the mailer.\n        #\n        # @example\n        #   deliver(:sample, :birthday, 'Joey', 21)\n        #   deliver(:example, :message, 'John')\n        #\n        def deliver(mailer_name, message_name, *attributes)\n          mailer = registered_mailers[mailer_name] or raise \"mailer '#{mailer_name}' is not registered\"\n          message = mailer.messages[message_name] or raise \"mailer '#{mailer_name}' has no message '#{message_name}'\"\n          message = message.call(*attributes)\n          message.delivery_method(*delivery_settings)\n          message.deliver\n        end\n\n        ##\n        # Delivers an email with the given mail attributes with specified and default settings.\n        #\n        # @param [Hash] mail_attributes\n        #   The attributes for this message (to, from, subject, cc, bcc, body, etc.).\n        # @param [Proc] block\n        #   The block mail attributes for this message.\n        #\n        # @example\n        #   MyApp.email(to: 'to@ma.il', from: 'from@ma.il', subject: 'Welcome!', body: 'Welcome Here!')\n        #\n        #   # or if you prefer blocks\n        #","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-mailer/lib/padrino-mailer/helpers.rb#L92-L128","documentation":"deliver resolves the mailer successfully, then looks the second argument up in that mailer's messages hash, which is populated only by email :name blocks declared inside the mailer. A message name with no matching email block raises this error, so the pair (mailer, message) must both be declared before delivering.","triggerScenarios":"Calling deliver(:sample, :anniversary, ...) when the Sample mailer only declares email :birthday; a message that was defined in a different mailer than the one named; renames or typos on either the email declaration or the deliver call site.","commonSituations":"Copy-pasting a deliver line and editing only one argument; splitting a large mailer and forgetting to move a message along with it; message names drifting from controller action names during refactoring.","solutions":["Declare the missing message inside the mailer: add email :anniversary do ... end to the mailers :sample block","Inspect available names with registered_mailers[:sample].messages.keys (or SampleMailer.messages.keys) and correct the call site","If the message lives in another mailer, deliver via that mailer's name instead"],"exampleFix":"# before\ndeliver(:sample, :anniversary, 'Joey')\n# mailer only declares email :birthday\n\n# after — app/mailers/sample.rb\nmailers :sample do\n  email :birthday     { ... }\n  email :anniversary  { ... }\nend\ndeliver(:sample, :anniversary, 'Joey')","handlingStrategy":"validation","validationCode":"mailer = registered_mailers[mailer_name]\nunless mailer && mailer.messages.key?(message_name)\n  fail mailer_name.to_s + ' has no message ' + message_name.inspect\nend\ndeliver(mailer_name, message_name, *attributes)","typeGuard":"def mailer_message_defined?(mailer_name, message_name)\n  registered_mailers[mailer_name.to_sym]&.messages&.key?(message_name.to_sym)\nend","tryCatchPattern":null,"preventionTips":["Keep deliver call sites next to their mailer definitions when refactoring","Inspect SampleMailer.messages.keys in a console when deliveries fail","Reload mailers in development after editing message names"],"tags":["padrino-mailer","deliver","unknown-message","dsl"],"backgroundTag":"unregistered-handler-lookup","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}