Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Mail renderer doesn't know routes #1296

Closed
lukasschlueter opened this issue Sep 7, 2018 · 2 comments
Closed

Mail renderer doesn't know routes #1296

lukasschlueter opened this issue Sep 7, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lukasschlueter
Copy link
Contributor

lukasschlueter commented Sep 7, 2018

Steps to Reproduce the Problem

Minimal setup:

  1. Create a new project
  2. Run buffalo g mailer Test
  3. Add SMTP credentials to .env
  4. Add handler that calls the new mailer, e.g.
app.GET("/send", func(context buffalo.Context) error {
	return mailers.SendTest()
})
  1. Specify mail receiver in mailers/test.go
  2. Edit templates/mail/test.html to include something like Website root : "<%= rootPath() %>"
  3. Open localhost:3000/send

Expected Behavior

Buffalo sends a mail to the specified email address containing Website root: "/".

Actual Behavior

Buffalo fails to render the template with the following error: test.html: line 3: rootPath: unknown identifier

Info

### Buffalo Version
v0.12.6

### App Information
Pwd=C:\Users\Lukas\go\src\gitlab.com\lukas-schlueter\test
Root=C:\Users\Lukas\go\src\gitlab.com\lukas-schlueter\test
GoPath=C:\Users\Lukas\go
Name=license_server
Bin=bin\license_server.exe
PackagePkg=gitlab.com/lukas-schlueter/test
ActionsPkg=gitlab.com/lukas-schlueter/test/actions
ModelsPkg=gitlab.com/lukas-schlueter/test/models
GriftsPkg=gitlab.com/lukas-schlueter/test/grifts
VCS=git
WithPop=true
WithSQLite=true
WithDep=false
WithWebpack=true
WithYarn=true
WithDocker=true
WithGrifts=true

### Go Version
go version go1.11 windows/amd64

### Go Env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Lukas\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Lukas\go
set GOPROXY=
set GORACE=
set GOROOT=D:\Programs\Go
set GOTMPDIR=
set GOTOOLDIR=D:\Programs\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\Lukas\go\src\gitlab.com\lukas-schlueter\test\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Lukas\AppData\Local\Temp\go-bui
ld962895198=/tmp/go-build -gno-record-gcc-switches

### Node Version
v8.11.1

### NPM Version
5.6.0

### Yarn Version
1.9.4

### PostgreSQL Version
PostgreSQL Not Found

### MySQL Version
MySQL Not Found

### SQLite Version
SQLite Not Found

### Dep Version
could not find a Gopkg.toml file

### Dep Status
could not find a Gopkg.toml file

@paganotoni paganotoni self-assigned this Sep 7, 2018
@kteb kteb added the enhancement New feature or request label Sep 12, 2018
@kteb kteb added this to the v0.13.0 milestone Sep 12, 2018
@kteb kteb self-assigned this Sep 20, 2018
@kteb
Copy link
Member

kteb commented Sep 20, 2018

As @paganotoni was busy I start working on it. I managed to have it on a local app, need to refactor it a bit and integrate it to the generator. I hope to have it for this week-end.

@paganotoni paganotoni removed their assignment Sep 22, 2018
markbates added a commit that referenced this issue Oct 1, 2018
….App). this fixes #1296 (#1338)

* adds a couple of new constructors for Message, including New(*buffalo.App). this fixes #1296

* Added app.RouteHelpers()

* updated deps
@markbates
Copy link
Member

fixed with #1338

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants