{"record":{"id":"f583204debd9fd13","repo":"padrino/padrino-framework","slug":"mailer-mailer-name-is-not-registered","errorCode":null,"errorMessage":"mailer '#{mailer_name}' is not registered","messagePattern":"mailer '#(.+?)' is not registered","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"padrino-mailer/lib/padrino-mailer/helpers.rb","lineNumber":109,"sourceCode":"        end\n        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","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-mailer/lib/padrino-mailer/helpers.rb#L91-L127","documentation":"MailerHelpers#deliver looks the first argument up in registered_mailers, a registry filled when mailer classes are defined with the mailers DSL and loaded by the app. If no mailer was ever registered under that name, deliver raises before building any message.","triggerScenarios":"Calling deliver(:sample, :birthday, 'Joey', 21) when no mailers :sample block exists anywhere; a typo'd or renamed mailer symbol; the mailer file never loading because it sits outside app/mailers or has a non-matching filename; delivering before the mailer is defined (load order problems, or manual registration in Sinatra integration).","commonSituations":"Forgetting to place or name the file under app/mailers so Padrino never loads it; renaming a mailer but not its call sites; using padrino-mailer inside Sinatra where mailers must be wired up manually; console sessions started before mailers reload.","solutions":["Define the mailer with mailers :sample do ... end in app/mailers/sample.rb so the conventional loader picks it up","Inspect what is registered from a console with registered_mailers.keys and match your symbol to it exactly","Fix typos and string/symbol mismatches in the mailer name argument","In Sinatra integration, register Padrino::Mailer and define all mailers before the first deliver call"],"exampleFix":"# before\ndeliver(:samples, :birthday, 'Joey', 21)  # typo: mailer is :sample\n\n# after\ndeliver(:sample, :birthday, 'Joey', 21)","handlingStrategy":"validation","validationCode":"unless registered_mailers.key?(mailer_name)\n  fail 'no mailer ' + mailer_name.inspect + ' (registered: ' + registered_mailers.keys.inspect + ')'\nend\ndeliver(mailer_name, message_name, *attributes)","typeGuard":"def registered_mailer?(name)\n  registered_mailers.key?(name.to_sym)\nend","tryCatchPattern":null,"preventionTips":["Name mailer files after their symbol under app/mailers so the conventional loader finds them","Cover every deliver pair with a unit test","Define mailers before any code that delivers, especially outside the standard app layout"],"tags":["padrino-mailer","deliver","unknown-mailer","registry-lookup"],"backgroundTag":"unregistered-handler-lookup","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}