Specify just a body without a view #44
              
                
                  
                  
                    Answered
                  
                  by
                    EriksonEnterprises
                  
              
          
                  
                    
                      EriksonEnterprises
                    
                  
                
                  asked this question in
                Q&A
              
            -
| I'm trying to pull a template from my database, so I was curious if I could just pass something like ->body($template), but that doesn't work How can I go about doing this? | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            EriksonEnterprises
          
      
      
        Jan 4, 2023 
      
    
    Replies: 1 comment
-
| Nevermind, I figured out how to do this... Just do: $template = dbquery; Email::compose() and do the rest in the mailable (app/mail/) like normal, and mailable view (views/emails) using: thanks | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        EriksonEnterprises
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Nevermind, I figured out how to do this... Just do:
$template = dbquery;
Email::compose()
->mailable(new OrderShipped($template))
->send();
and do the rest in the mailable (app/mail/) like normal,
and mailable view (views/emails) using:
{!! $template !!}
thanks