The interaction of a quantum field with a background containing a Dirac delta function with support on a surface of codimension 1 represents a particular kind of matching conditions on that surface for the field. In this paper, we show that the worldline formalism can be applied to this model. We obtain the asymptotic expansion of the heat kernel corresponding to a scalar field on in the presence of an arbitrary regular potential and subject to this kind of matching conditions on a flat surface. We also consider two such surfaces and compute their Casimir attraction due to the vacuum fluctuations of a massive scalar field weakly coupled to the corresponding Dirac deltas.